assertInstanceOf(TException::class, $exception); $this->assertSame($message, $exception->getMessage()); $this->assertSame($code, $exception->getCode()); } public function testExceptionWithSpecAndVals() { $spec = [ ['var' => 'string'], ['var' => 'int'], ['var' => 'bool'], ]; $vals = [ 'string' => 'Test value', 'int' => 123456, 'bool' => true, ]; $exception = new TException($spec, $vals); $this->assertEquals('Test value', $exception->string); $this->assertEquals(123456, $exception->int); $this->assertEquals(true, $exception->bool); } }