Example #1
0
 /**
  *
  */
 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);
 }
Example #2
0
 /**
  *
  */
 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);
 }