Example #1
0
 public function testConstruct()
 {
     $type = new Type('object', true, 'ArrayObject', true, new Type('int'), new Type('string'));
     $this->assertEquals(Type::BUILTIN_TYPE_OBJECT, $type->getBuiltinType());
     $this->assertTrue($type->isNullable());
     $this->assertEquals('ArrayObject', $type->getClassName());
     $this->assertTrue($type->isCollection());
     $collectionKeyType = $type->getCollectionKeyType();
     $this->assertInstanceOf('PropertyInfo\\Type', $collectionKeyType);
     $this->assertEquals(Type::BUILTIN_TYPE_INT, $collectionKeyType->getBuiltinType());
     $collectionValueType = $type->getCollectionValueType();
     $this->assertInstanceOf('PropertyInfo\\Type', $collectionValueType);
     $this->assertEquals(Type::BUILTIN_TYPE_STRING, $collectionValueType->getBuiltinType());
 }