Skip to content

Commit c7d4ef5

Browse files
Add support for symfony 5 (#9)
1 parent 4c40744 commit c7d4ef5

10 files changed

+39
-21
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ composer.lock
22
vendor
33
tests/data
44
tests/migrations
5+
.phpunit.result.cache

Diff for: .travis.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ language: php
33
php:
44
- 5.6
55
- 7.1
6+
- 7.2
7+
- 7.3
68

79
env:
810
- PACKAGE_VERSION=high
@@ -13,10 +15,15 @@ matrix:
1315
include:
1416
- php: 5.6
1517
env: PACKAGE_VERSION=low
18+
- php: 7.4
19+
env:
20+
- MINIMUM_STABILITY=dev
21+
- PACKAGE_VERSION=high
1622

1723
before_script:
1824
- composer selfupdate
25+
- if [[ "$MINIMUM_STABILITY" ]]; then composer config minimum-stability $MINIMUM_STABILITY ; fi
1926
- if [[ "$PACKAGE_VERSION" == "high" ]]; then composer update --prefer-dist; fi
2027
- if [[ "$PACKAGE_VERSION" == "low" ]]; then composer update --prefer-lowest --prefer-dist; fi
2128

22-
script: vendor/bin/phpunit
29+
script: vendor/bin/simple-phpunit

Diff for: composer.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
}
1010
],
1111
"require": {
12-
"phpcr/phpcr": "~2.1",
13-
"symfony/finder": "~2.8 || ~3.4 || ~4.0",
14-
"symfony/console": "~2.8 || ~3.4 || ~4.0"
12+
"phpcr/phpcr": "^2.1",
13+
"symfony/finder": "^2.8 || ^3.4 || ^4.0 || ^5.0",
14+
"symfony/console": "^2.8 || ^3.4 || ^4.0 || ^5.0"
1515
},
1616
"require-dev": {
17-
"phpunit/phpunit": "~5.7",
18-
"jackalope/jackalope-fs": "dev-master",
19-
"zendframework/zendsearch": "@dev"
17+
"symfony/phpunit-bridge": "^5.0.4",
18+
"jackalope/jackalope-fs": "0.0.*",
19+
"handcraftedinthealps/zendsearch": "^2.0"
2020
},
2121
"autoload": {
2222
"psr-4": {
@@ -29,6 +29,6 @@
2929
}
3030
},
3131
"extra": {
32-
"branch-alias": {"dev-master": "1.0-dev" }
32+
"branch-alias": {"dev-master": "1.x-dev" }
3333
}
3434
}

Diff for: phpunit.xml.dist

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
colors="true"
66
bootstrap="vendor/autoload.php"
77
>
8+
<php>
9+
<env name="SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT" value="1"/>
10+
<env name="SYMFONY_PHPUNIT_REMOVE" value="symfony/yaml"/>
11+
<env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled=1"/>
12+
</php>
813

914
<testsuites>
1015
<testsuite name="PHPCR migrations Test Suite">

Diff for: tests/BaseTestCase.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313

1414
use Jackalope\RepositoryFactoryFilesystem;
1515
use PHPCR\SimpleCredentials;
16+
use PHPUnit\Framework\TestCase;
1617
use Symfony\Component\Filesystem\Filesystem;
1718

18-
class BaseTestCase extends \PHPUnit_Framework_TestCase
19+
class BaseTestCase extends TestCase
1920
{
2021
protected $session;
2122

Diff for: tests/Functional/MigrationTest.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace PHPCR\Migrations\tests\Functional;
1313

1414
use PHPCR\Migrations\BaseTestCase;
15+
use PHPCR\Migrations\Exception\MigratorException;
1516
use PHPCR\Migrations\Migrator;
1617
use PHPCR\Migrations\VersionFinder;
1718
use PHPCR\Migrations\VersionStorage;
@@ -161,15 +162,16 @@ public function testInitialize()
161162

162163
/**
163164
* It should throw an exception if trying to reiniitialize.
164-
*
165-
* @expectedException PHPCR\Migrations\Exception\MigratorException
166-
* @expectedExceptionMessage Will not re-initialize
167165
*/
168166
public function testReinitialize()
169167
{
170168
$this->addVersion(self::VERSION1);
171169
$this->addVersion(self::VERSION2);
170+
172171
$this->getMigrator()->initialize();
172+
173+
$this->expectException(MigratorException::class);
174+
$this->expectExceptionMessage('Will not re-initialize');
173175
$this->getMigrator()->initialize();
174176
}
175177

Diff for: tests/Unit/MigratorFactoryTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
use PHPCR\Migrations\VersionFinder;
1818
use PHPCR\Migrations\VersionStorage;
1919
use PHPCR\SessionInterface;
20+
use PHPUnit\Framework\TestCase;
2021

21-
class MigratorFactoryTest extends \PHPUnit_Framework_TestCase
22+
class MigratorFactoryTest extends TestCase
2223
{
2324
public function testFactory()
2425
{

Diff for: tests/Unit/MigratorUtilTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
namespace PHPCR\Migrations\tests\Unit;
1313

1414
use PHPCR\Migrations\MigratorUtil;
15+
use PHPUnit\Framework\TestCase;
1516

16-
class MigratorUtilTest extends \PHPUnit_Framework_TestCase
17+
class MigratorUtilTest extends TestCase
1718
{
1819
/**
1920
* It should return the classname of a file.

Diff for: tests/Unit/VersionCollectionTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313

1414
use PHPCR\Migrations\VersionCollection;
1515
use PHPCR\Migrations\VersionInterface;
16+
use PHPUnit\Framework\TestCase;
1617

17-
class VersionCollectionTest extends \PHPUnit_Framework_TestCase
18+
class VersionCollectionTest extends TestCase
1819
{
1920
const VERSION1 = '201501010000';
2021
const VERSION2 = '201501020000';

Diff for: tests/Unit/VersionFinderTest.php

+5-6
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313

1414
use PHPCR\Migrations\VersionCollection;
1515
use PHPCR\Migrations\VersionFinder;
16+
use PHPUnit\Framework\TestCase;
1617

17-
class VersionFinderTest extends \PHPUnit_Framework_TestCase
18+
class VersionFinderTest extends TestCase
1819
{
1920
public function setUp()
2021
{
@@ -38,13 +39,11 @@ public function testGetCollection()
3839

3940
/**
4041
* It should do nothing if no migrations paths are given.
41-
*
42-
* @expectedException \RuntimeException
43-
* @expectedExceptionMessage No paths were provided
4442
*/
4543
public function testNoMigrationPaths()
4644
{
47-
$collection = (new VersionFinder(array()))->getCollection();
48-
$versions = $collection->getAllVersions();
45+
$this->expectException(\RuntimeException::class);
46+
$this->expectExceptionMessage('No paths were provided');
47+
$versionFinder = new VersionFinder(array());
4948
}
5049
}

0 commit comments

Comments
 (0)