Removed hacks for Windows OS (Because it isn't work fine all the same)

This commit is contained in:
Dmitry Khomutov 2017-02-01 22:27:47 +07:00
commit 8779880a8f
No known key found for this signature in database
GPG key ID: 7EB36C9576F9ECB9
23 changed files with 36 additions and 240 deletions

View file

@ -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__);
}

View file

@ -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());
}
}

View file

@ -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();

View file

@ -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'));