Fixed tests for Security

This commit is contained in:
Dmitry Khomutov 2017-01-08 00:08:11 +07:00
parent 4e3e841b04
commit 041f8090b0
No known key found for this signature in database
GPG key ID: 7EB36C9576F9ECB9
2 changed files with 5 additions and 5 deletions

View file

@ -22,11 +22,11 @@ class UniqueEmailAndNameUserFields extends AbstractMigration
$user_table = $this->table('user');
if ($user_table->hasIndex('email', ['unique' => true])) {
$user_table->removeIndex('email', ['unique' => true])->save();
$user_table->removeIndex(['email'], ['unique' => true])->save();
}
if ($user_table->hasIndex('name', ['unique' => true])) {
$user_table->removeIndex('name', ['unique' => true])->save();
$user_table->removeIndex(['name'], ['unique' => true])->save();
}
}
}

View file

@ -27,7 +27,7 @@ class ServiceTest extends \PHPUnit_Framework_TestCase
*/
public function testBuildBuiltinProvider()
{
$provider = Service::buildProvider('test', ['internal' => ['type' => 'internal']]);
$provider = Service::buildProvider('test', ['type' => 'internal']);
$this->assertInstanceOf('\PHPCensor\Security\Authentication\UserProvider\Internal', $provider);
}
@ -37,10 +37,10 @@ class ServiceTest extends \PHPUnit_Framework_TestCase
*/
public function testBuildAnyProvider()
{
$config = array('type' => '\PHPCensor\Security\Authentication\Tests\DummyProvider');
$config = array('type' => '\Tests\PHPCensor\Security\Authentication\DummyProvider');
$provider = Service::buildProvider("test", $config);
$this->assertInstanceOf('\PHPCensor\Security\Authentication\Tests\DummyProvider', $provider);
$this->assertInstanceOf('\Tests\PHPCensor\Security\Authentication\DummyProvider', $provider);
$this->assertEquals('test', $provider->key);
$this->assertEquals($config, $provider->config);
}