/** * */ function test_php_runtime_exception() { try { PHPException::runtime('foo'); } catch (\Exception $exception) { } $this->assertEquals('foo', $exception->getMessage()); $this->assertEquals(__FILE__, $exception->getFile()); $this->assertEquals(39, $exception->getLine()); $this->assertInstanceOf(\RuntimeException::class, $exception); }
/** * */ function test_php_invalid_argument_exception() { try { PHPException::invalidArgument('foo'); } catch (\Exception $exception) { } $this->assertEquals('foo', $exception->getMessage()); $this->assertEquals(__FILE__, $exception->getFile()); $this->assertEquals(39, $exception->getLine()); $this->assertInstanceOf(\InvalidArgumentException::class, $exception); }