Skip to content

Commit 1c26996

Browse files
authored
Merge pull request #109 from chalasr/sf-5
Allow Symfony 5
2 parents ddf6561 + c42e65b commit 1c26996

File tree

4 files changed

+27
-28
lines changed

4 files changed

+27
-28
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ cache:
77
env:
88
global:
99
- SYMFONY_PHPUNIT_REMOVE="symfony/yaml"
10-
- SYMFONY_DEPRECATIONS_HELPER="max[direct]=0&max[indirect]=0"
10+
- SYMFONY_DEPRECATIONS_HELPER="max[direct]=0"
1111

1212
branches:
1313
only: [master, stable]

composer.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,32 @@
1010
, "illuminate/database": "^5.5"
1111
, "illuminate/events": "^5.5"
1212
, "illuminate/console": "^5.5"
13-
, "symfony/dependency-injection": "^3.0 || ^4.0"
13+
, "symfony/dependency-injection": "^3.0 || ^4.0 || ^5.0"
1414
, "jdorn/sql-formatter": "^1.2"
1515
}
1616
, "require-dev": {
17-
"symfony/console": "^3.0 || ^4.0"
18-
, "symfony/event-dispatcher": "^3.0 || ^4.0"
19-
, "symfony/framework-bundle": "^3.0 || ^4.0"
20-
, "symfony/http-kernel": "^3.0 || ^4.0"
21-
, "symfony/finder": "^3.0 || ^4.0"
22-
, "symfony/debug": "^3.0 || ^4.0"
23-
, "symfony/yaml": "^3.0 || ^4.0"
24-
, "symfony/form": "^3.0 || ^4.0"
17+
"symfony/console": "^3.0 || ^4.0 || ^5.0"
18+
, "symfony/event-dispatcher": "^3.0 || ^4.0 || ^5.0"
19+
, "symfony/framework-bundle": "^3.0 || ^4.0 || ^5.0"
20+
, "symfony/http-kernel": "^3.0 || ^4.0 || ^5.0"
21+
, "symfony/finder": "^3.0 || ^4.0 || ^5.0"
22+
, "symfony/debug": "^3.0 || ^4.0 || ^5.0"
23+
, "symfony/yaml": "^3.0 || ^4.0 || ^5.0"
24+
, "symfony/form": "^3.0 || ^4.0 || ^5.0"
2525
, "symfony/phpunit-bridge": "^4.4"
26-
, "symfony/browser-kit": "^3.0 || ^4.0"
27-
, "symfony/dom-crawler": "^3.0 || ^4.0"
28-
, "symfony/validator": "^3.0 || ^4.0"
29-
, "symfony/twig-bundle": "^3.0 || ^4.0"
30-
, "symfony/twig-bridge": "^3.0 || ^4.0"
31-
, "symfony/var-dumper": "^3.0 || ^4.0"
26+
, "symfony/browser-kit": "^3.0 || ^4.0 || ^5.0"
27+
, "symfony/dom-crawler": "^3.0 || ^4.0 || ^5.0"
28+
, "symfony/validator": "^3.0 || ^4.0 || ^5.0"
29+
, "symfony/twig-bundle": "^3.0 || ^4.0 || ^5.0"
30+
, "symfony/twig-bridge": "^3.0 || ^4.0 || ^5.0"
31+
, "symfony/var-dumper": "^3.0 || ^4.0 || ^5.0"
3232
, "twig/twig": "^1.26 || ^2.0"
3333
, "doctrine/annotations": "1.*"
3434
}
3535
, "conflict": { "hhvm": "*" }
3636
, "suggests": {
37-
"symfony/console": "To use commands for seeding and migration. (^3.0|^4.0)"
38-
, "symfony/event-dispatcher": "To auto initialize the Eloquent ORM. (^3.0|^4.0)"
37+
"symfony/console": "To use commands for seeding and migration. (^3.0|^4.0|^5.0)"
38+
, "symfony/event-dispatcher": "To auto initialize the Eloquent ORM. (^3.0|^4.0|^5.0)"
3939
}
4040

4141
, "autoload": { "psr-4": { "WouterJ\\EloquentBundle\\": "src" } }

phpunit.xml.dist

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
</filter>
1414

1515
<listeners>
16-
<listener class="WouterJ\EloquentBundle\FunctionalTestListener"/>
1716
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
1817
</listeners>
18+
19+
<extensions>
20+
<extension class="WouterJ\EloquentBundle\FunctionalTestListener"/>
21+
</extensions>
1922
</phpunit>

tests/FunctionalTestListener.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,22 @@
1111

1212
namespace WouterJ\EloquentBundle;
1313

14-
use PHPUnit\Framework\Test;
15-
use PHPUnit\Framework\TestListener;
16-
use PHPUnit\Framework\TestListenerDefaultImplementation;
17-
use PHPUnit\Framework\TestSuite;
14+
use PHPUnit\Runner\BeforeFirstTestHook;
15+
use PHPUnit\Runner\BeforeTestHook;
1816

1917
/**
2018
* Automatically creates the database that's
2119
* required for the functional tests.
2220
*
2321
* @author Wouter J <wouter@wouterj.nl>
2422
*/
25-
class FunctionalTestListener implements TestListener
23+
class FunctionalTestListener implements BeforeFirstTestHook, BeforeTestHook
2624
{
27-
use TestListenerDefaultImplementation;
28-
2925
private static $started = false;
3026
private static $dbFile;
3127
private static $backupFile;
3228

33-
public function startTestSuite(TestSuite $suite): void
29+
public function executeBeforeFirstTest(): void
3430
{
3531
if (!self::$started) {
3632
self::$started = true;
@@ -65,7 +61,7 @@ public function startTestSuite(TestSuite $suite): void
6561
}
6662
}
6763

68-
public function startTest(Test $test): void
64+
public function executeBeforeTest(string $test): void
6965
{
7066
// reset to initial file
7167
copy(static::$backupFile, static::$dbFile);

0 commit comments

Comments
 (0)