dox Executable Documentation

watoki-scrut

specification

Load dependencies

Inject property annotations

Given the class 'SomeFixture' in namespace 'spec\\watoki\\scrut\\tmp'
Given the class definition ' /** * @property spec\\watoki\\scrut\\tmp\\SomeFixture foo <- */ class SomeTest extends \\watoki\\scrut\\Specification { function runAllScenarios($prefix = "test") { $this->setUp(); } } '
When I run the test 'SomeTest'
Then it should have a property 'foo' with an instance of 'spec\\watoki\\scrut\\tmp\\SomeFixture'

Reference to test

Given the class definition ' class FixtureWithReference extends \\watoki\\scrut\\Fixture { public function __construct(\\watoki\\scrut\\Specification $spec, \\watoki\\factory\\Factory $factory) { spec\\watoki\\scrut\\specification\\LoadDependenciesTest::$testReference = get_class($spec); } } ' in file 'FixtureWithReference.php'
Given the class definition ' /** * @property FixtureWithReference foo <- */ class TestReferenceTest extends \\watoki\\scrut\\Specification { function runAllScenarios($prefix = "test") { $this->setUp(); } } '
When I run the test 'TestReferenceTest'
Then 'TestReferenceTest' should be passed to the fixture

Load dependencies of fixture

Given the class definition ' class Dependency extends \\watoki\\scrut\\Fixture {} ' in file 'Dependency.php'
Given the class definition ' /** * @property Dependency bar <- */ class FixtureWithDependencies extends \\watoki\\scrut\\Fixture {} ' in file 'FixtureWithDependencies.php'
Given the class definition ' /** * @property FixtureWithDependencies foo <- */ class FixtureWithDependenciesTest extends \\watoki\\scrut\\Specification { function runAllScenarios($prefix = "test") { $this->setUp(); spec\\watoki\\scrut\\specification\\LoadDependenciesTest::$loaded[] = get_class($this->foo->bar); } } '
When I run the test 'FixtureWithDependenciesTest'
Then 1 fixtures should be loaded
Then loaded fixture 1 should be 'Dependency'