File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Prophecy \PhpUnit \Tests \Fixtures ;
4+
5+ use PHPUnit \Framework \TestCase ;
6+ use Prophecy \PhpUnit \ProphecyTrait ;
7+
8+ class NoProphecy extends TestCase
9+ {
10+ use ProphecyTrait;
11+
12+ public function testMethod ()
13+ {
14+ // to avoid warnings/risky status
15+ $ this ->assertTrue (true );
16+ }
17+ }
Original file line number Diff line number Diff line change 66use PHPUnit \Runner \BaseTestRunner ;
77use Prophecy \PhpUnit \Tests \Fixtures \Error ;
88use Prophecy \PhpUnit \Tests \Fixtures \MockFailure ;
9+ use Prophecy \PhpUnit \Tests \Fixtures \NoProphecy ;
910use Prophecy \PhpUnit \Tests \Fixtures \SpyFailure ;
1011use Prophecy \PhpUnit \Tests \Fixtures \Success ;
1112
@@ -73,4 +74,17 @@ public function testDoublingError(): void
7374 $ this ->assertSame (0 , $ test ->getNumAssertions ());
7475 $ this ->assertSame (BaseTestRunner::STATUS_ERROR , $ test ->getStatus ());
7576 }
77+
78+ public function testNoProphecy (): void
79+ {
80+ $ test = new NoProphecy ('testMethod ' );
81+
82+ $ result = $ test ->run ();
83+
84+ $ this ->assertSame (0 , $ result ->errorCount ());
85+ $ this ->assertSame (0 , $ result ->failureCount ());
86+ $ this ->assertCount (1 , $ result );
87+ $ this ->assertSame (1 , $ test ->getNumAssertions ());
88+ $ this ->assertSame (BaseTestRunner::STATUS_PASSED , $ test ->getStatus ());
89+ }
7690}
You can’t perform that action at this time.
0 commit comments