Skip to content

Commit 035062e

Browse files
committed
Fix the CI build
1 parent 70e4ab9 commit 035062e

4 files changed

Lines changed: 40 additions & 23 deletions

File tree

.travis.yml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,31 @@ sudo: false
55
cache:
66
directories:
77
- $HOME/.composer/cache/files
8+
- $HOME/.phpunit-bridge
9+
10+
env:
11+
global:
12+
- SYMFONY_PHPUNIT_DIR=$HOME/.phpunit-bridge
13+
14+
php: [7.2, 7.1, 7.0, 5.6, 5.5, 5.4]
815

916
matrix:
1017
include:
11-
- php: 5.3
18+
- php: 7.2
1219
env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable'
13-
- php: 5.4
14-
- php: 5.5
15-
- php: 5.6
16-
- php: 7.0
17-
- php: 7.1
18-
env: DEPENDENCIES=dev
19-
- php: hhvm
20-
21-
before_script:
22-
- if [ "$DEPENDENCIES" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi;
23-
- composer update $COMPOSER_FLAGS
24-
25-
script: phpunit --coverage-text --coverage-clover=coverage.clover
20+
- php: 5.3
21+
dist: precise
22+
- php: 7.2
23+
env: STABILITY=dev
24+
25+
before_install:
26+
- if [[ -v $STABILITY ]]; then composer config minimum-stability $STABILITY; fi;
27+
28+
install:
29+
- composer update --prefer-dist --no-interaction $COMPOSER_FLAGS
30+
- vendor/bin/simple-phpunit install
31+
32+
script: vendor/bin/simple-phpunit --coverage-text --coverage-clover=coverage.clover
2633

2734
after_script:
2835
- wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover

Tests/ProcessorTest.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
namespace Incenteev\ParameterHandler\Tests;
44

55
use Incenteev\ParameterHandler\Processor;
6-
use Prophecy\PhpUnit\ProphecyTestCase;
6+
use PHPUnit\Framework\TestCase;
77
use Symfony\Component\Filesystem\Filesystem;
88
use Symfony\Component\Yaml\Yaml;
99

10-
class ProcessorTest extends ProphecyTestCase
10+
class ProcessorTest extends TestCase
1111
{
1212
private $io;
1313
private $environmentBackup = array();
@@ -45,7 +45,12 @@ public function testInvalidConfiguration(array $config, $exceptionMessage)
4545
{
4646
chdir(__DIR__);
4747

48-
$this->setExpectedException('InvalidArgumentException', $exceptionMessage);
48+
if (method_exists($this, 'expectException')) {
49+
$this->expectException('InvalidArgumentException');
50+
$this->expectExceptionMessage($exceptionMessage);
51+
} else {
52+
$this->setExpectedException('InvalidArgumentException', $exceptionMessage);
53+
}
4954

5055
$this->processor->processFile($config);
5156
}

Tests/ScriptHandlerTest.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
namespace Incenteev\ParameterHandler\Tests;
44

55
use Incenteev\ParameterHandler\ScriptHandler;
6-
use Prophecy\PhpUnit\ProphecyTestCase;
6+
use PHPUnit\Framework\TestCase;
77

8-
class ScriptHandlerTest extends ProphecyTestCase
8+
class ScriptHandlerTest extends TestCase
99
{
1010
private $event;
1111
private $io;
@@ -34,7 +34,12 @@ public function testInvalidConfiguration(array $extras, $exceptionMessage)
3434

3535
chdir(__DIR__);
3636

37-
$this->setExpectedException('InvalidArgumentException', $exceptionMessage);
37+
if (method_exists($this, 'expectException')) {
38+
$this->expectException('InvalidArgumentException');
39+
$this->expectExceptionMessage($exceptionMessage);
40+
} else {
41+
$this->setExpectedException('InvalidArgumentException', $exceptionMessage);
42+
}
3843

3944
ScriptHandler::buildParameters($this->event->reveal());
4045
}

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
"symfony/yaml": "^2.3 || ^3.0 || ^4.0"
1616
},
1717
"require-dev": {
18-
"composer/composer": "^1.0",
19-
"phpspec/prophecy-phpunit": "~1.0",
20-
"symfony/filesystem": "^2.2 || ^3.0 || ^4.0"
18+
"composer/composer": "^1.0@dev",
19+
"symfony/filesystem": "^2.3 || ^3 || ^4",
20+
"symfony/phpunit-bridge": "^4.0"
2121
},
2222
"autoload": {
2323
"psr-4": { "Incenteev\\ParameterHandler\\": "" }

0 commit comments

Comments
 (0)