File tree 8 files changed +20
-13
lines changed
8 files changed +20
-13
lines changed Original file line number Diff line number Diff line change @@ -2,3 +2,4 @@ composer.lock
2
2
vendor
3
3
tests /data
4
4
tests /migrations
5
+ .phpunit.result.cache
Original file line number Diff line number Diff line change 7
7
>
8
8
<php >
9
9
<env name =" SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT" value =" 1" />
10
+ <env name =" SYMFONY_PHPUNIT_REMOVE" value =" symfony/yaml" />
10
11
</php >
11
12
12
13
<testsuites >
Original file line number Diff line number Diff line change 13
13
14
14
use Jackalope \RepositoryFactoryFilesystem ;
15
15
use PHPCR \SimpleCredentials ;
16
+ use PHPUnit \Framework \TestCase ;
16
17
use Symfony \Component \Filesystem \Filesystem ;
17
18
18
- class BaseTestCase extends \PHPUnit_Framework_TestCase
19
+ class BaseTestCase extends TestCase
19
20
{
20
21
protected $ session ;
21
22
Original file line number Diff line number Diff line change 12
12
namespace PHPCR \Migrations \tests \Functional ;
13
13
14
14
use PHPCR \Migrations \BaseTestCase ;
15
+ use PHPCR \Migrations \Exception \MigratorException ;
15
16
use PHPCR \Migrations \Migrator ;
16
17
use PHPCR \Migrations \VersionFinder ;
17
18
use PHPCR \Migrations \VersionStorage ;
@@ -161,15 +162,16 @@ public function testInitialize()
161
162
162
163
/**
163
164
* It should throw an exception if trying to reiniitialize.
164
- *
165
- * @expectedException PHPCR\Migrations\Exception\MigratorException
166
- * @expectedExceptionMessage Will not re-initialize
167
165
*/
168
166
public function testReinitialize ()
169
167
{
170
168
$ this ->addVersion (self ::VERSION1 );
171
169
$ this ->addVersion (self ::VERSION2 );
170
+
172
171
$ this ->getMigrator ()->initialize ();
172
+
173
+ $ this ->expectException (MigratorException::class);
174
+ $ this ->expectExceptionMessage ('Will not re-initialize ' );
173
175
$ this ->getMigrator ()->initialize ();
174
176
}
175
177
Original file line number Diff line number Diff line change 17
17
use PHPCR \Migrations \VersionFinder ;
18
18
use PHPCR \Migrations \VersionStorage ;
19
19
use PHPCR \SessionInterface ;
20
+ use PHPUnit \Framework \TestCase ;
20
21
21
- class MigratorFactoryTest extends \PHPUnit_Framework_TestCase
22
+ class MigratorFactoryTest extends TestCase
22
23
{
23
24
public function testFactory ()
24
25
{
Original file line number Diff line number Diff line change 12
12
namespace PHPCR \Migrations \tests \Unit ;
13
13
14
14
use PHPCR \Migrations \MigratorUtil ;
15
+ use PHPUnit \Framework \TestCase ;
15
16
16
- class MigratorUtilTest extends \PHPUnit_Framework_TestCase
17
+ class MigratorUtilTest extends TestCase
17
18
{
18
19
/**
19
20
* It should return the classname of a file.
Original file line number Diff line number Diff line change 13
13
14
14
use PHPCR \Migrations \VersionCollection ;
15
15
use PHPCR \Migrations \VersionInterface ;
16
+ use PHPUnit \Framework \TestCase ;
16
17
17
- class VersionCollectionTest extends \PHPUnit_Framework_TestCase
18
+ class VersionCollectionTest extends TestCase
18
19
{
19
20
const VERSION1 = '201501010000 ' ;
20
21
const VERSION2 = '201501020000 ' ;
Original file line number Diff line number Diff line change 13
13
14
14
use PHPCR \Migrations \VersionCollection ;
15
15
use PHPCR \Migrations \VersionFinder ;
16
+ use PHPUnit \Framework \TestCase ;
16
17
17
- class VersionFinderTest extends \PHPUnit_Framework_TestCase
18
+ class VersionFinderTest extends TestCase
18
19
{
19
20
public function setUp ()
20
21
{
@@ -38,13 +39,11 @@ public function testGetCollection()
38
39
39
40
/**
40
41
* It should do nothing if no migrations paths are given.
41
- *
42
- * @expectedException \RuntimeException
43
- * @expectedExceptionMessage No paths were provided
44
42
*/
45
43
public function testNoMigrationPaths ()
46
44
{
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 ());
49
48
}
50
49
}
You can’t perform that action at this time.
0 commit comments