From e0fc0af637d21c809f7cdd2bdf530993bd3eba1b Mon Sep 17 00:00:00 2001 From: VolCh Date: Sun, 22 Oct 2017 12:59:19 +0300 Subject: [PATCH] Up lowes PHPUnit version to 4.8.36 (first supports PHPUnit 6 FC). Rewrite tests to use PHPUnit in 6.x style instead of 4.x --- composer.json | 2 +- .../BashCompletion/Common/CompletionHandlerTestCase.php | 3 ++- .../Console/BashCompletion/CompletionContextTest.php | 3 ++- .../Symfony/Console/BashCompletion/HookFactoryTest.php | 7 +++---- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index e00799e..196fb37 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "symfony/console": "~2.3 || ~3.0 || ~4.0" }, "require-dev": { - "phpunit/phpunit": "~4.4 || ~5.7 || ~6.4" + "phpunit/phpunit": "~4.8.36 || ~5.7 || ~6.4" }, "autoload": { "psr-4": { diff --git a/tests/Stecman/Component/Symfony/Console/BashCompletion/Common/CompletionHandlerTestCase.php b/tests/Stecman/Component/Symfony/Console/BashCompletion/Common/CompletionHandlerTestCase.php index f4d4a65..af4e743 100644 --- a/tests/Stecman/Component/Symfony/Console/BashCompletion/Common/CompletionHandlerTestCase.php +++ b/tests/Stecman/Component/Symfony/Console/BashCompletion/Common/CompletionHandlerTestCase.php @@ -2,6 +2,7 @@ namespace Stecman\Component\Symfony\Console\BashCompletion\Tests\Common; +use PHPUnit\Framework\TestCase; use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext; use Stecman\Component\Symfony\Console\BashCompletion\CompletionHandler; use Symfony\Component\Console\Application; @@ -9,7 +10,7 @@ /** * Base test case for running CompletionHandlers */ -abstract class CompletionHandlerTestCase extends \PHPUnit_Framework_TestCase +abstract class CompletionHandlerTestCase extends TestCase { /** * @var Application diff --git a/tests/Stecman/Component/Symfony/Console/BashCompletion/CompletionContextTest.php b/tests/Stecman/Component/Symfony/Console/BashCompletion/CompletionContextTest.php index 244ca33..9374d13 100644 --- a/tests/Stecman/Component/Symfony/Console/BashCompletion/CompletionContextTest.php +++ b/tests/Stecman/Component/Symfony/Console/BashCompletion/CompletionContextTest.php @@ -2,10 +2,11 @@ namespace Stecman\Component\Symfony\Console\BashCompletion\Tests; +use PHPUnit\Framework\TestCase; use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext; use Stecman\Component\Symfony\Console\BashCompletion\EnvironmentCompletionContext; -class CompletionContextTest extends \PHPUnit_Framework_TestCase +class CompletionContextTest extends TestCase { public function testWordBreakSplit() diff --git a/tests/Stecman/Component/Symfony/Console/BashCompletion/HookFactoryTest.php b/tests/Stecman/Component/Symfony/Console/BashCompletion/HookFactoryTest.php index f697cb5..c253a62 100644 --- a/tests/Stecman/Component/Symfony/Console/BashCompletion/HookFactoryTest.php +++ b/tests/Stecman/Component/Symfony/Console/BashCompletion/HookFactoryTest.php @@ -2,9 +2,10 @@ namespace Stecman\Component\Symfony\Console\BashCompletion\Tests; +use PHPUnit\Framework\TestCase; use Stecman\Component\Symfony\Console\BashCompletion\HookFactory; -class HookFactoryTest extends \PHPUnit_Framework_TestCase +class HookFactoryTest extends TestCase { /** * @var HookFactory @@ -91,9 +92,7 @@ protected function assertSyntaxIsValid($code, $syntaxCheckCommand, $context) $status = proc_close($process); - if ($status !== 0) { - $this->fail("Syntax check for $context failed:\n$output"); - } + $this->assertSame(0, $status, "Syntax check for $context failed:\n$output"); } else { throw new \RuntimeException("Failed to start process with command '$syntaxCheckCommand'"); }