Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make test suite compatible with PHPUnit 5.4. #5883

Merged
merged 1 commit into from
Jun 18, 2016
Merged

Make test suite compatible with PHPUnit 5.4. #5883

merged 1 commit into from
Jun 18, 2016

Conversation

sebastianbergmann
Copy link
Contributor

  • Use createMock() and getMockBuilder() instead of getMock()
  • Use expectException() and expectExceptionMessage() instead of setExpectedException()

Output with PHPUnit 4.8 before these changes

PHPUnit 4.8.26-3-ga973e60 by Sebastian Bergmann and contributors.

.........................................................E...   61 / 3111 (  1%)
............S................................................  122 / 3111 (  3%)
.............................................................  183 / 3111 (  5%)
.............................................................  244 / 3111 (  7%)
.............................................................  305 / 3111 (  9%)
.............................................................  366 / 3111 ( 11%)
.........................................S........SSSS.S.....  427 / 3111 ( 13%)
.............................................................  488 / 3111 ( 15%)
............................................F................  549 / 3111 ( 17%)
....................................SS.......................  610 / 3111 ( 19%)
.............................................................  671 / 3111 ( 21%)
.............................................................  732 / 3111 ( 23%)
.............................................................  793 / 3111 ( 25%)
.............................................................  854 / 3111 ( 27%)
....................F........................................  915 / 3111 ( 29%)
.............................................................  976 / 3111 ( 31%)
......................................S.SSSSSSSSSSSS......... 1037 / 3111 ( 33%)
......................................................F...... 1098 / 3111 ( 35%)
..................................................SS......... 1159 / 3111 ( 37%)
.....................S...S...........S....................... 1220 / 3111 ( 39%)
.......S.......................................F......F...... 1281 / 3111 ( 41%)
.............................S............................... 1342 / 3111 ( 43%)
......F...................................................... 1403 / 3111 ( 45%)
............................................................. 1464 / 3111 ( 47%)
..................SS.................................S....... 1525 / 3111 ( 49%)
............................................................. 1586 / 3111 ( 50%)
............................................................. 1647 / 3111 ( 52%)
............................................................. 1708 / 3111 ( 54%)
............................................................. 1769 / 3111 ( 56%)
............................................................. 1830 / 3111 ( 58%)
............................................................. 1891 / 3111 ( 60%)
............................................................. 1952 / 3111 ( 62%)
.............................................S............... 2013 / 3111 ( 64%)
...SSS.............................II........................ 2074 / 3111 ( 66%)
S................SSS......................................... 2135 / 3111 ( 68%)
............................................................. 2196 / 3111 ( 70%)
............................................................. 2257 / 3111 ( 72%)
............................................................. 2318 / 3111 ( 74%)
............................................................. 2379 / 3111 ( 76%)
............................................................. 2440 / 3111 ( 78%)
............................................................. 2501 / 3111 ( 80%)
............................................................. 2562 / 3111 ( 82%)
............................................................. 2623 / 3111 ( 84%)
............................................................. 2684 / 3111 ( 86%)
............................................................. 2745 / 3111 ( 88%)
............................................................. 2806 / 3111 ( 90%)
............................................................. 2867 / 3111 ( 92%)
............................................................. 2928 / 3111 ( 94%)
...................S.......S......S.......S.................. 2989 / 3111 ( 96%)
.....S...........S........................................... 3050 / 3111 ( 98%)
............................................................. 3111 / 3111 (100%)


Time: 10.07 seconds, Memory: 148.00MB

There was 1 error:

1) Doctrine\Tests\ORM\Cache\DefaultQueryCacheTest::testPutToOneAssociation2LevelsQueryResult
Undefined property: Doctrine\Tests\Models\Cache\City::$country

/usr/local/src/doctrine2/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php:782
/usr/local/src/doctrine2/lib/Doctrine/ORM/Cache/DefaultQueryCache.php:266
/usr/local/src/doctrine2/tests/Doctrine/Tests/ORM/Cache/DefaultQueryCacheTest.php:183

--

There were 6 failures:

1) Doctrine\Tests\ORM\Functional\ExtraLazyCollectionTest::testGetIndexByIdentifier
Getting the same entity should not cause an extra query to be executed
Failed asserting that 30 matches expected 28.

/usr/local/src/doctrine2/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php:772

2) Doctrine\Tests\ORM\Functional\ProxiesLikeEntitiesTest::testPersistUpdate
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'Marco Pivetta'
+'Marco'

/usr/local/src/doctrine2/tests/Doctrine/Tests/ORM/Functional/ProxiesLikeEntitiesTest.php:65

3) Doctrine\Tests\ORM\Functional\SecondLevelCacheOneToManyTest::testLoadOneToManyCollectionFromDatabaseWhenEntityMissing
Failed asserting that 17 matches expected 16.

/usr/local/src/doctrine2/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheOneToManyTest.php:151

4) Doctrine\Tests\ORM\Functional\Ticket\DDC1655Test::testPostLoadInheritanceChild
Failed asserting that 2 matches expected 1.

/usr/local/src/doctrine2/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1655Test.php:69

5) Doctrine\Tests\ORM\Functional\Ticket\DDC1690Test::testChangeTracking
Failed asserting that actual size 1 matches expected size 0.

/usr/local/src/doctrine2/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1690Test.php:57

6) Doctrine\Tests\ORM\Functional\Ticket\DDC2862Test::testIssueReopened
Failed asserting that 8 matches expected 7.

/usr/local/src/doctrine2/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2862Test.php:107

FAILURES!
Tests: 3111, Assertions: 11368, Errors: 1, Failures: 6, Skipped: 46, Incomplete: 2.

Output with PHPUnit 5.5-dev after these changes

PHPUnit 5.5-gf570814 by Sebastian Bergmann and contributors.

.........................................................E...   61 / 3111 (  1%)
............S................................................  122 / 3111 (  3%)
.............................................................  183 / 3111 (  5%)
.............................................................  244 / 3111 (  7%)
.............................................................  305 / 3111 (  9%)
.............................................................  366 / 3111 ( 11%)
.........................................S........SSSS.S.....  427 / 3111 ( 13%)
.............................................................  488 / 3111 ( 15%)
............................................F................  549 / 3111 ( 17%)
....................................SS.......................  610 / 3111 ( 19%)
.............................................................  671 / 3111 ( 21%)
.............................................................  732 / 3111 ( 23%)
.............................................................  793 / 3111 ( 25%)
.............................................................  854 / 3111 ( 27%)
....................F........................................  915 / 3111 ( 29%)
.............................................................  976 / 3111 ( 31%)
......................................S.SSSSSSSSSSSS......... 1037 / 3111 ( 33%)
......................................................F...... 1098 / 3111 ( 35%)
..................................................SS......... 1159 / 3111 ( 37%)
.....................S...S...........S....................... 1220 / 3111 ( 39%)
.......S.......................................F......F...... 1281 / 3111 ( 41%)
.............................S............................... 1342 / 3111 ( 43%)
......F...................................................... 1403 / 3111 ( 45%)
............................................................. 1464 / 3111 ( 47%)
..................SS.................................S....... 1525 / 3111 ( 49%)
............................................................. 1586 / 3111 ( 50%)
............................................................. 1647 / 3111 ( 52%)
............................................................. 1708 / 3111 ( 54%)
............................................................. 1769 / 3111 ( 56%)
............................................................. 1830 / 3111 ( 58%)
............................................................. 1891 / 3111 ( 60%)
............................................................. 1952 / 3111 ( 62%)
.............................................S............... 2013 / 3111 ( 64%)
...SSS.............................II........................ 2074 / 3111 ( 66%)
S................SSS......................................... 2135 / 3111 ( 68%)
............................................................. 2196 / 3111 ( 70%)
............................................................. 2257 / 3111 ( 72%)
............................................................. 2318 / 3111 ( 74%)
............................................................. 2379 / 3111 ( 76%)
............................................................. 2440 / 3111 ( 78%)
............................................................. 2501 / 3111 ( 80%)
............................................................. 2562 / 3111 ( 82%)
............................................................. 2623 / 3111 ( 84%)
............................................................. 2684 / 3111 ( 86%)
............................................................. 2745 / 3111 ( 88%)
............................................................. 2806 / 3111 ( 90%)
............................................................. 2867 / 3111 ( 92%)
............................................................. 2928 / 3111 ( 94%)
...................S.......S......S.......S.................. 2989 / 3111 ( 96%)
.....S...........S........................................... 3050 / 3111 ( 98%)
............................................................. 3111 / 3111 (100%)


Time: 9.82 seconds, Memory: 152.00MB

There was 1 error:

1) Doctrine\Tests\ORM\Cache\DefaultQueryCacheTest::testPutToOneAssociation2LevelsQueryResult
Undefined property: Doctrine\Tests\Models\Cache\City::$country

/usr/local/src/doctrine2/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php:782
/usr/local/src/doctrine2/lib/Doctrine/ORM/Cache/DefaultQueryCache.php:266
/usr/local/src/doctrine2/tests/Doctrine/Tests/ORM/Cache/DefaultQueryCacheTest.php:183

--

There were 6 failures:

1) Doctrine\Tests\ORM\Functional\ExtraLazyCollectionTest::testGetIndexByIdentifier
Getting the same entity should not cause an extra query to be executed
Failed asserting that 30 matches expected 28.

/usr/local/src/doctrine2/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php:772

2) Doctrine\Tests\ORM\Functional\ProxiesLikeEntitiesTest::testPersistUpdate
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'Marco Pivetta'
+'Marco'

/usr/local/src/doctrine2/tests/Doctrine/Tests/ORM/Functional/ProxiesLikeEntitiesTest.php:65

3) Doctrine\Tests\ORM\Functional\SecondLevelCacheOneToManyTest::testLoadOneToManyCollectionFromDatabaseWhenEntityMissing
Failed asserting that 17 matches expected 16.

/usr/local/src/doctrine2/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheOneToManyTest.php:151

4) Doctrine\Tests\ORM\Functional\Ticket\DDC1655Test::testPostLoadInheritanceChild
Failed asserting that 2 matches expected 1.

/usr/local/src/doctrine2/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1655Test.php:69

5) Doctrine\Tests\ORM\Functional\Ticket\DDC1690Test::testChangeTracking
Failed asserting that actual size 1 matches expected size 0.

/usr/local/src/doctrine2/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1690Test.php:57

6) Doctrine\Tests\ORM\Functional\Ticket\DDC2862Test::testIssueReopened
Failed asserting that 8 matches expected 7.

/usr/local/src/doctrine2/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2862Test.php:107

* Use createMock() and getMockBuilder() instead of getMock()
* Use expectException() and expectExceptionMessage() instead of setExpectedException()
@Ocramius Ocramius added this to the 2.6.0 milestone Jun 18, 2016
@Ocramius Ocramius self-assigned this Jun 18, 2016
@Ocramius
Copy link
Member

@sebastianbergmann thanks for doing this \o/

@Ocramius Ocramius merged commit 659f6a3 into doctrine:master Jun 18, 2016
@sebastianbergmann
Copy link
Contributor Author

Will try to do DBAL, too, but no promises.

@sebastianbergmann
Copy link
Contributor Author

Nevermind, just realized that DBAL still supports PHP 5.4 and PHP 5.5, so no PHPUnit 5.

@Ocramius
Copy link
Member

@sebastianbergmann I can drop support for those, gimme a few.

@Ocramius
Copy link
Member

@sebastianbergmann fyi: doctrine/dbal#2419 - can base work off that branch, should you still be interested in helping on this one :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants