Browse Source

reorder tests

euromark 11 years ago
parent
commit
6ba33e522f
3 changed files with 13 additions and 17 deletions
  1. 1 1
      Model/Qurl.php
  2. 1 0
      README.md
  3. 11 16
      Test/Case/Controller/Component/Auth/TinyAuthorizeTest.php

+ 1 - 1
Model/Qurl.php

@@ -91,7 +91,7 @@ class Qurl extends ToolsAppModel {
 		if (!$res) {
 			return false;
 		}
-		//$res['CodeKey']['url'] = Router::url($content['url'], true);
+
 		if ($res[$this->alias]['content']) {
 			$res[$this->alias]['content'] = unserialize($res[$this->alias]['content']);
 		} else {

+ 1 - 0
README.md

@@ -140,3 +140,4 @@ unless specified otherwise (in the classes).
 * 2013-02-25 Removed deprecated bootstrap functions and moved DebugTab functionality into Bootstrap namespace
   (you need to now manually include it if needed).
 * 2014-01 Changed Garbige to Garbage in method names.
+* 2014-02 Qlogin now uses Token model instead of deprecated CodeKey per default.

+ 11 - 16
Test/Case/Controller/Component/Auth/TinyAuthorizeTest.php

@@ -336,9 +336,7 @@ INI;
 		$res = $object->authorize($user, $this->request);
 		$this->assertTrue($res);
 
-		$this->request->params['controller'] = 'users';
-		$this->request->params['action'] = 'edit';
-
+		Configure::delete('Role');
 		$object = new TestTinyAuthorize($this->Collection, array('autoClearCache' => true));
 
 		$user = array(
@@ -349,36 +347,33 @@ INI;
 
 		$this->assertTrue((bool)(Configure::read('Role')));
 
-		// Multirole
+		// Multi-role test - failure
 		Configure::delete('Role');
-
 		$object = new TestTinyAuthorize($this->Collection, array('autoClearCache' => true));
 
-		// User role is 4 here, though. Also contains left joined Role date here just to check that it works, too.
 		$user = array(
 			'Role' => array(
-				array('id' => 4, 'alias' => 'user'),
-				array('id' => 6, 'alias' => 'partner'),
+				array('id' => 7, 'alias' => 'user'),
+				array('id' => 8, 'alias' => 'partner'),
 			)
 		);
 		$res = $object->authorize($user, $this->request);
-		$this->assertTrue($res);
+		$this->assertFalse($res);
 
-		$this->request->params['controller'] = 'users';
-		$this->request->params['action'] = 'edit';
+		$this->assertTrue((bool)(Configure::read('Role')));
 
+		Configure::delete('Role');
 		$object = new TestTinyAuthorize($this->Collection, array('autoClearCache' => true));
 
+		// Multi-role test
 		$user = array(
 			'Role' => array(
-				array('id' => 7, 'alias' => 'user'),
-				array('id' => 8, 'alias' => 'partner'),
+				array('id' => 4, 'alias' => 'user'),
+				array('id' => 6, 'alias' => 'partner'),
 			)
 		);
 		$res = $object->authorize($user, $this->request);
-		$this->assertFalse($res);
-
-		$this->assertTrue((bool)(Configure::read('Role')));
+		$this->assertTrue($res);
 	}
 
 }