PHPUnit_Framework_TestCase::assertInstanceOf PHP Method

assertInstanceOf() public method

public assertInstanceOf ( $className, $object )
    public function assertInstanceOf($className, $object)
    {
        if (get_class($object) != $className) {
            throw new Exception('Not instance of ' . $className . ', actually: ' . get_class($object));
        }
    }

Usage Example

コード例 #1
0
 protected function doCreate(RecordInterface $record, Version $version)
 {
     $this->testCase->assertEquals(3, $record->getUserId());
     $this->testCase->assertEquals('test', $record->getTitle());
     $this->testCase->assertInstanceOf('DateTime', $record->getDate());
     return array('success' => true, 'message' => 'You have successful create a record');
 }
All Usage Examples Of PHPUnit_Framework_TestCase::assertInstanceOf