MightNotMakeAssertions.php 627 B

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