dox Executable Documentation

Unwrap requests

Empty request

Given the box container 'outer' responding 'Hello $inner'
Given the box container 'inner' responding 'Inner'
Given 'outer' contains 'inner'
When I get the response from 'outer'
Then the response should be 'Hello Inner'

Change target

Given the box container 'outer' responding 'Hello $inner'
Given the box container 'inner' responding 'Inner'
Given the box container 'other' responding 'Other'
Given 'outer' contains 'inner'
Given the request argument '_inner/!' is 'other'
When I get the response from 'outer'
Then the response should be 'Hello Other'

Unwrap arguments

Given the box container 'outer' responding 'Hello $inner'
Given the box container 'inner' responding '$one $two'
Given 'outer' contains 'inner'
Given the request argument '_inner/one' is 'My'
Given the request argument '_inner/two' is 'World'
When I get the response from 'outer'
Then the response should be 'Hello My World'

Recursive unwrapping

Given the box container 'one' responding 'Hello $two'
Given the box container 'two' responding '$dos $three'
Given the box container 'three' responding '$tres'
Given 'one' contains 'two'
Given 'two' contains 'three'
Given the request argument '_two/_three/tres' is 'World'
Given the request argument '_two/dos' is 'There'
When I get the response from 'one'
Then the response should be 'Hello There World'

Box list

Given the box container 'outer' responding '$list'
Given the box container 'inner' responding '$foo'
Given 'outer' contains a collection 'list'
Given 'outer' has in 'list' a 'inner' with array('foo' => 'baz')
Given 'outer' has in 'list' a 'inner' with array('foo' => 'baz')
Given 'outer' has in 'list' a 'inner' with array('foo' => 'bar')
Given the request argument '_list/_0/foo' is 'One'
Given the request argument '_list/_1/foo' is 'Two'
When I get the response from 'outer'
Then the response should be 'One Two bar'

Method finds target

Given the box container 'root' responding 'Hello $foo $bar'
Given the box container 'foo' responding 'my'
Given the box container 'bar' responding 'dear $baz'
Given the box container 'baz' with body ' public function doFoo() { return "foo!"; }'
Given 'root' contains 'foo'
Given 'root' contains 'bar'
Given 'bar' contains 'baz'
Given the method is 'bar'
Given the request argument '_bar/_baz/do' is 'foo'
When I get the response from 'root'
Then the response should be 'Hello my dear foo!'

Method finds only target

Given the box container 'o' responding '$outer'
Given the box container 'outer' with body ' public function doNotGet() { return "not \\$list"; }'
Given the box container 'inner' responding '$foo'
Given 'o' contains 'outer'
Given 'outer' contains a collection 'list'
Given 'outer' has in 'list' a 'inner' with array('foo' => 'bar')
Given the request argument '_outer/do' is 'notGet'
When I get the response from 'o'
Then the response should be 'not bar'

Primary target is dispatched first

Given the box container 'root' responding '$a $b'
Given the box container 'a' with body ' public function doGet() { return $GLOBALS["foo"]; }'
Given the box container 'b' responding 'comes $c'
Given the box container 'c' with body ' public function doGet() { $GLOBALS["foo"] = "first"; return "c"; }'
Given 'root' contains 'a'
Given 'root' contains 'b'
Given 'b' contains 'c'
Given the request argument '_' is 'b'
Given the request argument 'b/_' is 'c'
When I get the response from 'root'
Then the response should be 'first comes c'

List as primary target

Given the box container 'o' responding '$inner'
Given the box container 'item' responding '$name'
Given 'o' contains a collection 'inner'
Given 'o' has in 'inner' a 'item' with array('name' => 'One')
Given 'o' has in 'inner' a 'item' with array('name' => 'Two')
Given the request argument '_' is 'inner'
Given the request argument '_inner/_' is '1'
When I get the response from 'o'
Then the response should be 'One Two'