dox Executable Documentation

Property annotation injection

Fully qualified class names

Given the class 'FullNameDependency' in the namespace 'some\\name\\space'
Given the class 'FullName' with the doc comment ' /** * @property some\\name\\space\\FullNameDependency foo <- */ '
When I get 'FullName' from the factory
Then there should be a property 'foo' with an instance of 'some\\name\\space\\FullNameDependency'

Relative namespace

Given the class 'RelativeDependency' in the namespace 'some\\name\\space'
Given the class 'Relative' in the name space 'some\\name' with the doc comment ' /** * @property space\\RelativeDependency foo <- */ '
When I get 'some\\name\\Relative' from the factory
Then there should be a property 'foo' with an instance of 'some\\name\\space\\RelativeDependency'

Class aliases

Given the class 'AliasedDependency' in the namespace 'some\\name\\space'
Given the class 'Aliased' with the doc comment ' use some\\name\\space\\AliasedDependency; /** * @property AliasedDependency foo <- */ '
When I get 'Aliased' from the factory
Then there should be a property 'foo' with an instance of 'some\\name\\space\\AliasedDependency'

Whitespaces

Given the class 'Whitespaces' with the doc comment ' /** * @property StdClass tabs <- * @property StdClass spaces <- */ '
When I get 'Whitespaces' from the factory
Then there should be a property 'tabs' with an instance of 'StdClass'
Then there should be a property 'spaces' with an instance of 'StdClass'

Dont inject not marked properties

Given the class 'NotMarked' with the doc comment ' /** * @property StdClass not * @property StdClass marked <- */ '
When I get 'NotMarked' from the factory
Then there should be a property 'marked' with an instance of 'StdClass'
Then the should be no property 'not'

Inject property with dollar sign

Given the class 'DollarSign' with the doc comment ' /** * @property StdClass $foo <- */ '
When I get 'DollarSign' from the factory
Then there should be a property 'foo' with an instance of 'StdClass'

Inject protected and private property

Given the class definition ' /** * @property StdClass protected <- * @property StdClass private <- */ class ProtectedAndPrivate { protected $protected; private $private; } '
When I get 'ProtectedAndPrivate' from the factory
$this->factoryFix->theTheProperty_ShouldBeAnInstanceOf('private', 'StdClass');
$this->factoryFix->theTheProperty_ShouldBeAnInstanceOf('protected', 'StdClass');

Order

Given the class definition ' class First { function __construct() { \\spec\\watoki\\factory\\FactoryFixture::$loaded[] = get_class($this); } } '
Given the class definition ' class Second { function __construct() { \\spec\\watoki\\factory\\FactoryFixture::$loaded[] = get_class($this); } } '
Given the class 'OrderMatters' with the doc comment ' /** * @property First foo <- * @property Second bar <- */ '
When I get 'OrderMatters' from the factory
Then the loaded dependency 1 should be 'First'
Then the loaded dependency 2 should be 'Second'

Create members

Given the class definition ' /** * @property StdClass foo <- */ class BaseAnnotationClass {} '
Given the class definition ' /** * @property StdClass bar <- */ class ChildAnnotationClass extends BaseAnnotationClass {} '
When I get 'ChildAnnotationClass' from the factory
Then there should be a property 'bar' with an instance of 'StdClass'
Then there should be a property 'foo' with an instance of 'StdClass'

Inherit property annotation

Given the class 'BaseClassDependency' in the namespace 'some\\name\\space'
Given the class 'BaseWithInjectedProperty' with the doc comment ' /** * @property some\\name\\space\\BaseClassDependency foo <- */ '
Given the class definition ' class InheritsProperty extends BaseWithInjectedProperty {} '
When I get 'InheritsProperty' from the factory
Then there should be a property 'foo' with an instance of 'some\\name\\space\\BaseClassDependency'