ExceptionHandlingTest.php 502 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace Test\Depo\UniTester;
  3. use Depo\UniTester\TestCase;
  4. class ExceptionHandlingTest extends TestCase
  5. {
  6. protected function setUp(): void
  7. {
  8. }
  9. protected function tearDown(): void
  10. {
  11. }
  12. protected function execute(): void
  13. {
  14. $this->testExceptionThrown();
  15. }
  16. public function testExceptionThrown()
  17. {
  18. $this->expectException(\LogicException::class, function() {
  19. throw new \LogicException("Test exception");
  20. });
  21. }
  22. }