Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame^] | 1 | <?php |
| 2 | |
| 3 | namespace Tests; |
| 4 | |
| 5 | trait MightNotMakeAssertions |
| 6 | { |
| 7 | /** |
| 8 | * This is a shim to support PHPUnit for php 5.6 and 7.0. |
| 9 | * |
| 10 | * It has to be named something that doesn't collide with existing |
| 11 | * TestCase methods as we can't support PHP return types right now |
| 12 | * |
| 13 | * @return void |
| 14 | */ |
| 15 | public function noAssertionsMade() |
| 16 | { |
| 17 | foreach (class_parents($this) as $parent) { |
| 18 | if (method_exists($parent, 'expectNotToPerformAssertions')) { |
| 19 | parent::expectNotToPerformAssertions(); |
| 20 | return; |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | $this->assertTrue(true); |
| 25 | } |
| 26 | } |