|
@@ 56-67 (lines=12) @@
|
| 53 |
|
/** |
| 54 |
|
* @covers \Hamcrest\Adapter\PHPUnit\TestListener::endTest() |
| 55 |
|
*/ |
| 56 |
|
public function testShouldCallAddToAssertionCountOnTestEnd() |
| 57 |
|
{ |
| 58 |
|
$listener = new TestListener(); |
| 59 |
|
|
| 60 |
|
$test = m::mock(TestCase::class); |
| 61 |
|
$test->shouldReceive('addToAssertionCount')->with(1)->once(); |
| 62 |
|
|
| 63 |
|
// Bump the hamcrest assertion count by 1. |
| 64 |
|
assertThat(true, is(true)); |
| 65 |
|
|
| 66 |
|
$listener->endTest($test, 0.0); |
| 67 |
|
} |
| 68 |
|
|
| 69 |
|
/** |
| 70 |
|
* @covers \Hamcrest\Adapter\PHPUnit\TestListener::endTest() |
|
@@ 72-83 (lines=12) @@
|
| 69 |
|
/** |
| 70 |
|
* @covers \Hamcrest\Adapter\PHPUnit\TestListener::endTest() |
| 71 |
|
*/ |
| 72 |
|
public function testShouldOnlyCallAddToAssertionCountOnTestCases() |
| 73 |
|
{ |
| 74 |
|
$listener = new TestListener(); |
| 75 |
|
|
| 76 |
|
$test = m::mock(Test::class); |
| 77 |
|
$test->shouldReceive('addToAssertionCount')->never(); |
| 78 |
|
|
| 79 |
|
// Bump the hamcrest assertion count by 1. |
| 80 |
|
assertThat(true, is(true)); |
| 81 |
|
|
| 82 |
|
$listener->endTest($test, 0.0); |
| 83 |
|
} |
| 84 |
|
|
| 85 |
|
/** |
| 86 |
|
* @covers \Hamcrest\Adapter\PHPUnit\TestListener::endTest() |