public hasProperty ( string $propertyName ) : boolean | ||
$propertyName | string | Name of the property |
return | boolean |
public function hasProperty($propertyName)
{
return array_key_exists($propertyName, $this->properties);
}
/** * @test */ public function hasPropertyReturnsTrueOnlyForExistingProperties() { $classSchema = new ClassSchema('SomeClass'); $classSchema->addProperty('a', 'string'); $classSchema->addProperty('b', 'integer'); $this->assertTrue($classSchema->hasProperty('a')); $this->assertTrue($classSchema->hasProperty('b')); $this->assertFalse($classSchema->hasProperty('c')); }