Finished up security class testing.

This commit is contained in:
Joshua Sherman 2014-01-18 11:43:23 -05:00
parent 30b9616b12
commit 72be314073
3 changed files with 12 additions and 69 deletions

View file

@ -100,7 +100,6 @@ class SecurityTest extends PHPUnit_Framework_TestCase
$this->assertFalse(Security::isLevel(SECURITY_LEVEL_USER));
}
/*
public function testIsLevelDB()
{
$config = Config::getInstance();
@ -127,6 +126,7 @@ class SecurityTest extends PHPUnit_Framework_TestCase
'namespace' => '',
],
],
'security' => ['model' => 'MockUserModel'],
];
$model = new MockUserModel();
@ -141,9 +141,14 @@ class SecurityTest extends PHPUnit_Framework_TestCase
Security::login(1, 10, 'USER');
//$this->assertTrue(Security::isLevel([SECURITY_LEVEL_USER, SECURITY_LEVEL_ADMIN]));
unset(
$_SESSION['__pickles']['security']['token'],
$_COOKIE['pickles_security_token'],
$_SESSION['__pickles']['security']['level']
);
$this->assertFalse(Security::isLevel([SECURITY_LEVEL_USER, SECURITY_LEVEL_ADMIN]));
}
*/
}
?>

View file

@ -23,7 +23,7 @@ DROP TABLE IF EXISTS users;
CREATE TABLE `users` (
`id` int(1) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`role` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'USER',
`level` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'USER',
`created_id` int(1) unsigned DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_id` int(1) unsigned DEFAULT NULL,