diff --git a/.travis.yml b/.travis.yml index e3421d0..4adce84 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,6 @@ before_script: - composer install --prefer-source php: - - 5.5 - - 5.6 - 7.0 - - hhvm + - 7.1 + - 7.2 \ No newline at end of file diff --git a/composer.json b/composer.json index 51512e6..b421f69 100644 --- a/composer.json +++ b/composer.json @@ -21,14 +21,14 @@ } ], "require": { - "php" : ">=5.5", + "php" : "~7.0", "evenement/evenement" : "^2.0|^1.0", "monolog/monolog" : "^1.3", "psr/log" : "^1.0", "symfony/process" : "^2.0|^3.0" }, "require-dev": { - "phpunit/phpunit" : "^4.0" + "phpunit/phpunit" : "~6.0" }, "autoload": { "psr-0": { diff --git a/src/Alchemy/BinaryDriver/BinaryDriverTestCase.php b/src/Alchemy/BinaryDriver/BinaryDriverTestCase.php index 3d0463d..061c07b 100644 --- a/src/Alchemy/BinaryDriver/BinaryDriverTestCase.php +++ b/src/Alchemy/BinaryDriver/BinaryDriverTestCase.php @@ -2,20 +2,21 @@ namespace Alchemy\BinaryDriver; +use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; use Symfony\Component\Process\Process; /** * Convenient PHPUnit methods for testing BinaryDriverInterface implementations. */ -class BinaryDriverTestCase extends \PHPUnit_Framework_TestCase +class BinaryDriverTestCase extends TestCase { /** * @return ProcessBuilderFactoryInterface */ public function createProcessBuilderFactoryMock() { - return $this->getMock('Alchemy\BinaryDriver\ProcessBuilderFactoryInterface'); + return $this->createMock('Alchemy\BinaryDriver\ProcessBuilderFactoryInterface'); } /** @@ -63,7 +64,7 @@ public function createProcessMock($runs = 1, $success = true, $commandLine = nul */ public function createLoggerMock() { - return $this->getMock('Psr\Log\LoggerInterface'); + return $this->createMock('Psr\Log\LoggerInterface'); } /** @@ -71,6 +72,6 @@ public function createLoggerMock() */ public function createConfigurationMock() { - return $this->getMock('Alchemy\BinaryDriver\ConfigurationInterface'); + return $this->createMock('Alchemy\BinaryDriver\ConfigurationInterface'); } } diff --git a/tests/Alchemy/Tests/BinaryDriver/AbstractBinaryTest.php b/tests/Alchemy/Tests/BinaryDriver/AbstractBinaryTest.php index f51ab6f..40371d2 100644 --- a/tests/Alchemy/Tests/BinaryDriver/AbstractBinaryTest.php +++ b/tests/Alchemy/Tests/BinaryDriver/AbstractBinaryTest.php @@ -61,21 +61,21 @@ public function testMultipleLoadWithBinaryName() public function testLoadWithMultiplePathExpectingAFailure() { - $this->setExpectedException(ExecutableNotFoundException::class); + $this->expectException(ExecutableNotFoundException::class); Implementation::load(array('bachibouzouk', 'moribon')); } public function testLoadWithUniquePathExpectingAFailure() { - $this->setExpectedException(ExecutableNotFoundException::class); + $this->expectException(ExecutableNotFoundException::class); Implementation::load('bachibouzouk'); } public function testLoadWithCustomLogger() { - $logger = $this->getMock('Psr\Log\LoggerInterface'); + $logger = $this->createMock('Psr\Log\LoggerInterface'); $imp = Implementation::load('php', $logger); $this->assertEquals($logger, $imp->getProcessRunner()->getLogger()); @@ -91,7 +91,7 @@ public function testLoadWithCustomConfigurationAsArray() public function testLoadWithCustomConfigurationAsObject() { - $conf = $this->getMock('Alchemy\BinaryDriver\ConfigurationInterface'); + $conf = $this->createMock('Alchemy\BinaryDriver\ConfigurationInterface'); $imp = Implementation::load('php', null, $conf); $this->assertEquals($conf, $imp->getConfiguration()); @@ -100,7 +100,7 @@ public function testLoadWithCustomConfigurationAsObject() public function testProcessBuilderFactoryGetterAndSetters() { $imp = Implementation::load('php'); - $factory = $this->getMock('Alchemy\BinaryDriver\ProcessBuilderFactoryInterface'); + $factory = $this->createMock('Alchemy\BinaryDriver\ProcessBuilderFactoryInterface'); $imp->setProcessBuilderFactory($factory); $this->assertEquals($factory, $imp->getProcessBuilderFactory()); @@ -109,7 +109,7 @@ public function testProcessBuilderFactoryGetterAndSetters() public function testConfigurationGetterAndSetters() { $imp = Implementation::load('php'); - $conf = $this->getMock('Alchemy\BinaryDriver\ConfigurationInterface'); + $conf = $this->createMock('Alchemy\BinaryDriver\ConfigurationInterface'); $imp->setConfiguration($conf); $this->assertEquals($conf, $imp->getConfiguration()); @@ -132,7 +132,7 @@ public function testTimeoutIsSetOnProcessBuilderSetting() { $imp = Implementation::load('php', null, array('timeout' => 42)); - $factory = $this->getMock('Alchemy\BinaryDriver\ProcessBuilderFactoryInterface'); + $factory = $this->createMock('Alchemy\BinaryDriver\ProcessBuilderFactoryInterface'); $factory->expects($this->once()) ->method('setTimeout') ->with(42); @@ -148,7 +148,7 @@ public function testListenRegistersAListener() ->disableOriginalConstructor() ->getMock(); - $listener = $this->getMock('Alchemy\BinaryDriver\Listeners\ListenerInterface'); + $listener = $this->createMock('Alchemy\BinaryDriver\Listeners\ListenerInterface'); $listeners->expects($this->once()) ->method('register') @@ -168,8 +168,8 @@ public function testListenRegistersAListener() public function testCommandRunsAProcess($parameters, $bypassErrors, $expectedParameters, $output) { $imp = Implementation::load('php'); - $factory = $this->getMock('Alchemy\BinaryDriver\ProcessBuilderFactoryInterface'); - $processRunner = $this->getMock('Alchemy\BinaryDriver\ProcessRunnerInterface'); + $factory = $this->createMock('Alchemy\BinaryDriver\ProcessBuilderFactoryInterface'); + $processRunner = $this->createMock('Alchemy\BinaryDriver\ProcessRunnerInterface'); $process = $this->getMockBuilder('Symfony\Component\Process\Process') ->disableOriginalConstructor() @@ -197,8 +197,8 @@ public function testCommandRunsAProcess($parameters, $bypassErrors, $expectedPar public function testCommandWithTemporaryListeners($parameters, $bypassErrors, $expectedParameters, $output, $count, $listeners) { $imp = Implementation::load('php'); - $factory = $this->getMock('Alchemy\BinaryDriver\ProcessBuilderFactoryInterface'); - $processRunner = $this->getMock('Alchemy\BinaryDriver\ProcessRunnerInterface'); + $factory = $this->createMock('Alchemy\BinaryDriver\ProcessBuilderFactoryInterface'); + $processRunner = $this->createMock('Alchemy\BinaryDriver\ProcessRunnerInterface'); $process = $this->getMockBuilder('Symfony\Component\Process\Process') ->disableOriginalConstructor() @@ -263,7 +263,7 @@ public function testUnlistenUnregistersAListener() ->disableOriginalConstructor() ->getMock(); - $listener = $this->getMock('Alchemy\BinaryDriver\Listeners\ListenerInterface'); + $listener = $this->createMock('Alchemy\BinaryDriver\Listeners\ListenerInterface'); $listeners->expects($this->once()) ->method('unregister') @@ -282,7 +282,7 @@ public function testUnlistenUnregistersAListener() */ private function getMockListener() { - $listener = $this->getMock(ListenerInterface::class); + $listener = $this->createMock(ListenerInterface::class); $listener->expects($this->any()) ->method('forwardedEvents') ->willReturn(array()); diff --git a/tests/Alchemy/Tests/BinaryDriver/AbstractProcessBuilderFactoryTest.php b/tests/Alchemy/Tests/BinaryDriver/AbstractProcessBuilderFactoryTest.php index de0b61c..2f3e059 100644 --- a/tests/Alchemy/Tests/BinaryDriver/AbstractProcessBuilderFactoryTest.php +++ b/tests/Alchemy/Tests/BinaryDriver/AbstractProcessBuilderFactoryTest.php @@ -4,8 +4,9 @@ use Symfony\Component\Process\ExecutableFinder; use Alchemy\BinaryDriver\ProcessBuilderFactory; +use PHPUnit\Framework\TestCase; -abstract class AbstractProcessBuilderFactoryTest extends \PHPUnit_Framework_TestCase +abstract class AbstractProcessBuilderFactoryTest extends TestCase { public static $phpBinary; diff --git a/tests/Alchemy/Tests/BinaryDriver/ConfigurationTest.php b/tests/Alchemy/Tests/BinaryDriver/ConfigurationTest.php index b2cd2dd..063539b 100644 --- a/tests/Alchemy/Tests/BinaryDriver/ConfigurationTest.php +++ b/tests/Alchemy/Tests/BinaryDriver/ConfigurationTest.php @@ -3,8 +3,9 @@ namespace Alchemy\Tests\BinaryDriver; use Alchemy\BinaryDriver\Configuration; +use PHPUnit\Framework\TestCase; -class ConfigurationTest extends \PHPUnit_Framework_TestCase +class ConfigurationTest extends TestCase { public function testArrayAccessImplementation() { diff --git a/tests/Alchemy/Tests/BinaryDriver/Listeners/DebugListenerTest.php b/tests/Alchemy/Tests/BinaryDriver/Listeners/DebugListenerTest.php index 6995867..1b2f1c9 100644 --- a/tests/Alchemy/Tests/BinaryDriver/Listeners/DebugListenerTest.php +++ b/tests/Alchemy/Tests/BinaryDriver/Listeners/DebugListenerTest.php @@ -4,8 +4,9 @@ use Alchemy\BinaryDriver\Listeners\DebugListener; use Symfony\Component\Process\Process; +use PHPUnit\Framework\TestCase; -class DebugListenerTest extends \PHPUnit_Framework_TestCase +class DebugListenerTest extends TestCase { public function testHandle() { diff --git a/tests/Alchemy/Tests/BinaryDriver/Listeners/ListenersTest.php b/tests/Alchemy/Tests/BinaryDriver/Listeners/ListenersTest.php index fe96d73..62a2d7f 100644 --- a/tests/Alchemy/Tests/BinaryDriver/Listeners/ListenersTest.php +++ b/tests/Alchemy/Tests/BinaryDriver/Listeners/ListenersTest.php @@ -5,8 +5,9 @@ use Alchemy\BinaryDriver\Listeners\Listeners; use Evenement\EventEmitter; use Alchemy\BinaryDriver\Listeners\ListenerInterface; +use PHPUnit\Framework\TestCase; -class ListenersTest extends \PHPUnit_Framework_TestCase +class ListenersTest extends TestCase { public function testRegister() {