Removed hacks for Windows OS (Because it isn't work fine all the same)
This commit is contained in:
parent
7e735bbb3b
commit
8779880a8f
23 changed files with 36 additions and 240 deletions
|
|
@ -21,17 +21,11 @@ class CommandExecutorTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
protected function setUp()
|
||||
{
|
||||
if (IS_WIN) {
|
||||
$this->markTestSkipped("Cannot test UnixCommandExecutor on ".PHP_OS);
|
||||
return;
|
||||
}
|
||||
parent::setUp();
|
||||
|
||||
$mockBuildLogger = $this->prophesize('PHPCensor\Logging\BuildLogger');
|
||||
|
||||
$class = IS_WIN
|
||||
? 'PHPCensor\Helper\WindowsCommandExecutor'
|
||||
: 'PHPCensor\Helper\UnixCommandExecutor';
|
||||
$class = 'PHPCensor\Helper\UnixCommandExecutor';
|
||||
$this->testedExecutor = new $class($mockBuildLogger->reveal(), __DIR__);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
<?php
|
||||
namespace Tests\PHPCensor\ProcessControl;
|
||||
|
||||
use PHPCensor\ProcessControl\WindowsProcessControl;
|
||||
|
||||
class WindowsProcessControlTest extends ProcessControlTest
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
$this->object = new WindowsProcessControl();
|
||||
}
|
||||
|
||||
public function getTestCommand()
|
||||
{
|
||||
return "pause";
|
||||
}
|
||||
|
||||
public function testIsAvailable()
|
||||
{
|
||||
$this->assertEquals(DIRECTORY_SEPARATOR === '\\', WindowsProcessControl::isAvailable());
|
||||
}
|
||||
}
|
||||
|
|
@ -14,17 +14,11 @@ use PHPCensor\Security\Authentication\Service;
|
|||
|
||||
class ServiceTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Service::getInstance
|
||||
*/
|
||||
public function testGetInstance()
|
||||
{
|
||||
$this->assertInstanceOf('\PHPCensor\Security\Authentication\Service', Service::getInstance());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Service::buildProvider
|
||||
*/
|
||||
public function testBuildBuiltinProvider()
|
||||
{
|
||||
$provider = Service::buildProvider('test', ['type' => 'internal']);
|
||||
|
|
@ -32,9 +26,6 @@ class ServiceTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertInstanceOf('\PHPCensor\Security\Authentication\UserProvider\Internal', $provider);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Service::buildProvider
|
||||
*/
|
||||
public function testBuildAnyProvider()
|
||||
{
|
||||
$config = ['type' => '\Tests\PHPCensor\Security\Authentication\DummyProvider'];
|
||||
|
|
@ -45,9 +36,6 @@ class ServiceTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertEquals($config, $provider->config);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Service::getProviders
|
||||
*/
|
||||
public function testGetProviders()
|
||||
{
|
||||
$a = $this->prophesize('\PHPCensor\Security\Authentication\UserProviderInterface')->reveal();
|
||||
|
|
@ -59,9 +47,6 @@ class ServiceTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertEquals($providers, $service->getProviders());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Service::getLoginPasswordProviders
|
||||
*/
|
||||
public function testGetLoginPasswordProviders()
|
||||
{
|
||||
$a = $this->prophesize('\PHPCensor\Security\Authentication\UserProviderInterface')->reveal();
|
||||
|
|
|
|||
|
|
@ -27,9 +27,6 @@ class InternalTest extends \PHPUnit_Framework_TestCase
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Internal::verifyPassword
|
||||
*/
|
||||
public function testVerifyPassword()
|
||||
{
|
||||
$user = new User();
|
||||
|
|
@ -39,9 +36,6 @@ class InternalTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertTrue($this->provider->verifyPassword($user, $password));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Internal::verifyPassword
|
||||
*/
|
||||
public function testVerifyInvaldPassword()
|
||||
{
|
||||
$user = new User();
|
||||
|
|
@ -51,17 +45,11 @@ class InternalTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertFalse($this->provider->verifyPassword($user, 'bar'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Internal::checkRequirements
|
||||
*/
|
||||
public function testCheckRequirements()
|
||||
{
|
||||
$this->provider->checkRequirements();
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Internal::provisionUser
|
||||
*/
|
||||
public function testProvisionUser()
|
||||
{
|
||||
$this->assertNull($this->provider->provisionUser('john@doe.com'));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue