Skip to content

Commit c181d55

Browse files
authored
Allow PHP 8 and PHPUnit 8+9 (#4)
1 parent e086669 commit c181d55

File tree

5 files changed

+25
-7
lines changed

5 files changed

+25
-7
lines changed

.php_cs.dist

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ return PhpCsFixer\Config::create()
3838
'phpdoc_add_missing_param_annotation' => true,
3939
'phpdoc_order' => true,
4040
'semicolon_after_instruction' => true,
41+
'single_line_throw' => false,
4142
'strict_comparison' => true,
4243
'strict_param' => true,
4344
))

.travis.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,10 @@ jobs:
5959
-
6060
<<: *STANDARD_TEST_JOB
6161
stage: Test
62-
php: 7.3
62+
php: 7.4
63+
64+
-
65+
<<: *STANDARD_TEST_JOB
66+
stage: Test
67+
php: nightly
6368
env: COMPOSER_FLAGS="--ignore-platform-reqs"

composer.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
}
1111
],
1212
"require": {
13-
"php": "^5.5.9 || ^7.0",
13+
"php": "^5.6 || ^7.0 || ^8.0",
1414
"symfony/process": "^3.4 || ^4 || ^5"
1515
},
1616
"require-dev": {
17-
"friendsofphp/php-cs-fixer": "^2.9",
17+
"friendsofphp/php-cs-fixer": "^2.16",
1818
"maglnet/composer-require-checker": "^0.1.6",
19-
"phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1",
19+
"phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1 || ^8 || ^9",
2020
"symfony/phpunit-bridge": "^4.0 || ^5.0"
2121
},
2222
"config": {

tests/CommandExecutorTest.php

+10-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ public function testSimpleExecution()
2727

2828
$cliResult = $scriptExecutor->getResult();
2929

30-
$this->assertContains(basename(__FILE__), $cliResult->getOutput());
30+
if (\is_callable([$this, 'assertStringContainsString'])) {
31+
$this->assertStringContainsString(basename(__FILE__), $cliResult->getOutput());
32+
} else {
33+
$this->assertContains(basename(__FILE__), $cliResult->getOutput());
34+
}
3135
}
3236

3337
public function testSimpleExecutionWithArray()
@@ -36,6 +40,10 @@ public function testSimpleExecutionWithArray()
3640

3741
$cliResult = $scriptExecutor->getResult();
3842

39-
$this->assertContains(basename(__FILE__), $cliResult->getOutput());
43+
if (\is_callable([$this, 'assertStringContainsString'])) {
44+
$this->assertStringContainsString(basename(__FILE__), $cliResult->getOutput());
45+
} else {
46+
$this->assertContains(basename(__FILE__), $cliResult->getOutput());
47+
}
4048
}
4149
}

tests/ScriptExecutorTest.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ public function testSimpleExecution()
2727

2828
$cliResult = $scriptExecutor->getResult();
2929

30-
$this->assertContains(basename(__FILE__), $cliResult->getOutput());
30+
if (\is_callable([$this, 'assertStringContainsString'])) {
31+
$this->assertStringContainsString(basename(__FILE__), $cliResult->getOutput());
32+
} else {
33+
$this->assertContains(basename(__FILE__), $cliResult->getOutput());
34+
}
3135
}
3236
}

0 commit comments

Comments
 (0)