dox Executable Documentation

Load user configuration

Non existing file

When I load 'MyConfig.php'
Then an instance of 'name\\space\\BaseConfiguration' should be the singleton of 'name\\space\\BaseConfiguration'

Load user configuration

Given the file 'ThisConfiguration.php' with content '<?php namespace name\\space; class ThisConfiguration {}'
When I load 'ThisConfiguration.php'
Then an instance of 'name\\space\\ThisConfiguration' should be the singleton of 'name\\space\\BaseConfiguration'

Constructor parameters

Given the file 'ConfigurationWithConstructor.php' with content '<?php namespace name\\space; class ConfigurationWithConstructor { function __construct($foo) { $this->foo = $foo; } }'
When I load with the constructor arguments 'ConfigurationWithConstructor.php' array('foo' => 'bar')
Then an instance of 'name\\space\\ConfigurationWithConstructor' should be the singleton of 'name\\space\\BaseConfiguration'
Then the instance should have the property 'foo' with the value 'bar'

Empty file

Given the file 'MyConfig.php' with content '<?php #empty'
When I try to load 'MyConfig.php'
Then an exception containing 'Could not find class' should be thrown

Wrong namespace

Given the file 'WrongNamespace.php' with content '<?php namespace wrong\\name\\space; class WrongNamespace {}'
When I try to load 'WrongNamespace.php'
Then an exception containing 'Could not find class' should be thrown