Skip to content

Commit d6f4a13

Browse files
committed
Rewrite tests for PHPUnit 6
1 parent 5a58357 commit d6f4a13

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"symfony/console": "~2.3 || ~3.0"
1414
},
1515
"require-dev": {
16-
"phpunit/phpunit": "~4.4"
16+
"phpunit/phpunit": "~4.8.36 || ~5.7 || ~6.4"
1717
},
1818
"autoload": {
1919
"psr-4": {

tests/Stecman/Component/Symfony/Console/BashCompletion/Common/CompletionHandlerTestCase.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
namespace Stecman\Component\Symfony\Console\BashCompletion\Tests\Common;
44

5+
use PHPUnit\Framework\TestCase;
56
use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext;
67
use Stecman\Component\Symfony\Console\BashCompletion\CompletionHandler;
78
use Symfony\Component\Console\Application;
89

910
/**
1011
* Base test case for running CompletionHandlers
1112
*/
12-
abstract class CompletionHandlerTestCase extends \PHPUnit_Framework_TestCase
13+
abstract class CompletionHandlerTestCase extends TestCase
1314
{
1415
/**
1516
* @var Application

tests/Stecman/Component/Symfony/Console/BashCompletion/CompletionContextTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
namespace Stecman\Component\Symfony\Console\BashCompletion\Tests;
44

5+
use PHPUnit\Framework\TestCase;
56
use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext;
67
use Stecman\Component\Symfony\Console\BashCompletion\EnvironmentCompletionContext;
78

8-
class CompletionContextTest extends \PHPUnit_Framework_TestCase
9+
class CompletionContextTest extends TestCase
910
{
1011

1112
public function testWordBreakSplit()

tests/Stecman/Component/Symfony/Console/BashCompletion/HookFactoryTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
namespace Stecman\Component\Symfony\Console\BashCompletion\Tests;
44

5+
use PHPUnit\Framework\TestCase;
56
use Stecman\Component\Symfony\Console\BashCompletion\HookFactory;
67

7-
class HookFactoryTest extends \PHPUnit_Framework_TestCase
8+
class HookFactoryTest extends TestCase
89
{
910
/**
1011
* @var HookFactory
@@ -91,9 +92,7 @@ protected function assertSyntaxIsValid($code, $syntaxCheckCommand, $context)
9192

9293
$status = proc_close($process);
9394

94-
if ($status !== 0) {
95-
$this->fail("Syntax check for $context failed:\n$output");
96-
}
95+
$this->assertSame(0, $status, "Syntax check for $context failed:\n$output");
9796
} else {
9897
throw new \RuntimeException("Failed to start process with command '$syntaxCheckCommand'");
9998
}

0 commit comments

Comments
 (0)