Skip to content

Commit

Permalink
Merge pull request #72 from Kdyby/feature/php-7.2
Browse files Browse the repository at this point in the history
Test against PHP 7.2
  • Loading branch information
enumag authored Dec 3, 2017
2 parents f2cbd23 + 45ecb78 commit 6e7fa6b
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 33 deletions.
34 changes: 26 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,53 @@ php:
- 5.6
- 7.0
- 7.1
- 7.2

env:
matrix:
- SYMFONY=4.* # dev
- SYMFONY=3.* # dev
- SYMFONY=2.* # dev
- SYMFONY=4.* COMPOSER_EXTRA_ARGS="--prefer-stable"
- SYMFONY=3.* COMPOSER_EXTRA_ARGS="--prefer-stable"
- SYMFONY=2.* COMPOSER_EXTRA_ARGS="--prefer-stable"
- SYMFONY=4.* COMPOSER_EXTRA_ARGS="--prefer-lowest --prefer-stable"
- SYMFONY=3.* COMPOSER_EXTRA_ARGS="--prefer-lowest --prefer-stable"
- SYMFONY=2.* COMPOSER_EXTRA_ARGS="--prefer-lowest --prefer-stable"

matrix:
fast_finish: true
include:
- php: 7.1
env: SYMFONY=3.* COMPOSER_EXTRA_ARGS="--prefer-stable" COVERAGE="--coverage ./coverage.xml --coverage-src ./src" TESTER_RUNTIME="phpdbg"
- php: 7.1
env: SYMFONY=3.* COMPOSER_EXTRA_ARGS="--prefer-stable" PHPSTAN=1
- php: 7.1
env: SYMFONY=3.* COMPOSER_EXTRA_ARGS="--prefer-stable" CODING_STANDARD=1
- php: 7.2
env: SYMFONY=4.* COMPOSER_EXTRA_ARGS="--prefer-stable" COVERAGE="--coverage ./coverage.xml --coverage-src ./src" TESTER_RUNTIME="phpdbg"
- php: 7.2
env: SYMFONY=4.* COMPOSER_EXTRA_ARGS="--prefer-stable" PHPSTAN=1
- php: 7.2
env: SYMFONY=4.* COMPOSER_EXTRA_ARGS="--prefer-stable" CODING_STANDARD=1
exclude:
- php: 7.1
env: SYMFONY=3.* COMPOSER_EXTRA_ARGS="--prefer-stable"
- php: 7.2
env: SYMFONY=4.* COMPOSER_EXTRA_ARGS="--prefer-stable"
- php: 7.0
env: SYMFONY=4.*
- php: 7.0
env: SYMFONY=4.* COMPOSER_EXTRA_ARGS="--prefer-stable"
- php: 7.0
env: SYMFONY=4.* COMPOSER_EXTRA_ARGS="--prefer-lowest --prefer-stable"
- php: 5.6
env: SYMFONY=4.*
- php: 5.6
env: SYMFONY=4.* COMPOSER_EXTRA_ARGS="--prefer-stable"
- php: 5.6
env: SYMFONY=4.* COMPOSER_EXTRA_ARGS="--prefer-lowest --prefer-stable"
allow_failures:
- env: SYMFONY=4.*
- env: SYMFONY=3.*
- env: SYMFONY=2.*

before_install:
- if [[ $SYMFONY = '2.*' ]]; then composer require --no-update symfony/console:^2.8; fi
- if [[ $SYMFONY = '3.*' ]]; then composer require --no-update symfony/console:^3.0; fi
- if [[ $SYMFONY = '4.*' ]]; then composer require --no-update symfony/console:^4.0; fi

install:
- if [ "$CODING_STANDARD" = "1" ]; then composer require --dev --no-update kdyby/coding-standard:^1.0@dev; fi
Expand Down
17 changes: 9 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@
},
"require": {
"php": "^5.6 || ^7.0",
"nette/di": "^2.4@dev",
"nette/di": "^2.4.8@dev",
"tracy/tracy": "^2.4@dev",
"kdyby/strict-objects": "^1.0",
"symfony/console": "~2.3 || ^3.0"
"symfony/console": "~2.3 || ^3.0 || ^4.0"
},
"require-dev": {
"nette/application": "^2.4@dev",
"nette/bootstrap": "^2.4@dev",
"nette/http": "^2.4@dev",
"nette/tester": "~1.7",
"kdyby/events": "^3.1@dev",
"symfony/event-dispatcher": "~2.3 || ^3.0"
"nette/application": "^2.4.9@dev",
"nette/bootstrap": "^2.4.5@dev",
"nette/caching": "^2.5@dev",
"nette/http": "^2.4.7@dev",
"nette/tester": "^2.0",
"kdyby/events": "^3.1.1@dev",
"symfony/event-dispatcher": "~2.3 || ^3.0 || ^4.0"
},
"minimum-stability": "dev",
"suggest": {
Expand Down
2 changes: 0 additions & 2 deletions tests/KdybyTests/Console/ApplicationTest.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace KdybyTests\Console;

use Kdyby\Console\Application;
use Kdyby\Console\DI\ConsoleExtension;
use Kdyby\Console\FatalThrowableError;
use Kdyby\Events\DI\EventsExtension;
use Kdyby\Events\EventManager;
use Nette\Configurator;
Expand Down Expand Up @@ -81,7 +80,6 @@ class ApplicationTest extends \Tester\TestCase
Assert::same(42, $exitCode);

$output = $tester->getDisplay();
Assert::contains(FatalThrowableError::class, $output);
Assert::contains('Fuuuuck', $output);
}

Expand Down
10 changes: 2 additions & 8 deletions tests/KdybyTests/Console/InputErrorsTest.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,9 @@ class InputErrorsTest extends \Tester\TestCase
TesterEnvironment::skip($e->getMessage());
}

Assert::count(3, $listener->calls);
Assert::count(2, $listener->calls);
Assert::same('command', $listener->calls[0][0]);
try {
Assert::same('exception', $listener->calls[1][0]);
Assert::same('terminate', $listener->calls[2][0]);
} catch (\Tester\AssertException $e) {
Assert::same('terminate', $listener->calls[1][0]);
Assert::same('exception', $listener->calls[2][0]);
}
Assert::same('terminate', $listener->calls[1][0]);
}

}
Expand Down
7 changes: 0 additions & 7 deletions tests/KdybyTests/Console/data/ConsoleListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Symfony\Component\Console\ConsoleEvents;
use Symfony\Component\Console\Event\ConsoleCommandEvent;
use Symfony\Component\Console\Event\ConsoleExceptionEvent;
use Symfony\Component\Console\Event\ConsoleTerminateEvent;

class ConsoleListener implements \Kdyby\Events\Subscriber
Expand All @@ -24,7 +23,6 @@ public function getSubscribedEvents()
{
return [
ConsoleEvents::COMMAND,
ConsoleEvents::EXCEPTION,
ConsoleEvents::TERMINATE,
];
}
Expand All @@ -34,11 +32,6 @@ public function command(ConsoleCommandEvent $event)
$this->calls[] = [__FUNCTION__, get_class($event->getCommand())];
}

public function exception(ConsoleExceptionEvent $event)
{
$this->calls[] = [__FUNCTION__, get_class($event->getCommand()), $event->getException()];
}

public function terminate(ConsoleTerminateEvent $event)
{
$this->calls[] = [__FUNCTION__, get_class($event->getCommand()), $event->getExitCode()];
Expand Down

0 comments on commit 6e7fa6b

Please sign in to comment.