Skip to content

Commit

Permalink
Add test scenario for better @Depends warning messages
Browse files Browse the repository at this point in the history
  • Loading branch information
epdenouden authored and sebastianbergmann committed Feb 8, 2019
1 parent 0ecf7fd commit 76ae30b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
12 changes: 12 additions & 0 deletions tests/_files/DependencyFailureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,16 @@ public function testFour(): void
{
$this->assertTrue(true);
}

/**
* This test has been added to check the printed warnings for the user
* when a dependency simply doesn't exist.
*
* @depends doesNotExist
* @see https://github.com/sebastianbergmann/phpunit/issues/3517
*/
public function testHandlesDependsAnnotationForNonexistentTests(): void
{
$this->assertTrue(true);
}
}
9 changes: 6 additions & 3 deletions tests/end-to-end/dependencies-isolation.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ PHPUnit %s by Sebastian Bergmann and contributors.

Runtime: %s

...FSSS 7 / 7 (100%)
...FSSSS 8 / 8 (100%)

Time: %s, Memory: %s

Expand All @@ -27,7 +27,7 @@ There was 1 failure:

--

There were 3 skipped tests:
There were 4 skipped tests:

1) DependencyFailureTest::testTwo
This test depends on "DependencyFailureTest::testOne" to pass.
Expand All @@ -38,5 +38,8 @@ This test depends on "DependencyFailureTest::testTwo" to pass.
3) DependencyFailureTest::testFour
This test depends on "DependencyFailureTest::testOne" to pass.

4) DependencyFailureTest::testHandlesDependsAnnotationForNonexistentTests
This test depends on "DependencyFailureTest::doesNotExist" which does not exist

FAILURES!
Tests: 7, Assertions: 4, Failures: 1, Skipped: 3.
Tests: 8, Assertions: 4, Failures: 1, Skipped: 4.
9 changes: 6 additions & 3 deletions tests/end-to-end/dependencies.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ PHPUnit %s by Sebastian Bergmann and contributors.

Runtime: %s

...FSSS 7 / 7 (100%)
...FSSSS 8 / 8 (100%)

Time: %s, Memory: %s

Expand All @@ -26,7 +26,7 @@ There was 1 failure:

--

There were 3 skipped tests:
There were 4 skipped tests:

1) DependencyFailureTest::testTwo
This test depends on "DependencyFailureTest::testOne" to pass.
Expand All @@ -37,5 +37,8 @@ This test depends on "DependencyFailureTest::testTwo" to pass.
3) DependencyFailureTest::testFour
This test depends on "DependencyFailureTest::testOne" to pass.

4) DependencyFailureTest::testHandlesDependsAnnotationForNonexistentTests
This test depends on "DependencyFailureTest::doesNotExist" which does not exist

FAILURES!
Tests: 7, Assertions: 4, Failures: 1, Skipped: 3.
Tests: 8, Assertions: 4, Failures: 1, Skipped: 4.

0 comments on commit 76ae30b

Please sign in to comment.