dox Executable Documentation

Parse specification

Parse a specification class and its methods and also their doc comments

Specification class

When I parse ' namespace some\\name\\space; class SomeSpecificationTest {}'
Then there should be a specification with the name 'Some specification'

Specification with description

When I parse ' /** * This is my * *DocComment* text. * * @var not this */ class SomeTest {}'
Then the specification should have the description 'This is my *DocComment* text.'

Scenarios

When I parse ' class SomeTest { function testSomeStuff() {} function testSomeMoreStuff() {} }'
Then there should be 2 scenarios
Then scenario 1 should have the name 'Some stuff'
Then scenario 2 should have the name 'Some more stuff'

Scenario with description

When I parse ' class SomeTest { /** * This is the description * of this scenario. */ function testSomeStuff() {} }'
Then scenario 1 should have the description 'This is the description of this scenario.'

Scenario with code

When I parse ' class SomeTest { public function testSomeStuff() { $code = 1 + 1; } }'
Then scenario 1 should have the content '[ { "content": "$code = 1 + 1;", "type": "code" } ]'

Ignore private and protected methods

When I parse ' class SomeTest { public function testSomeStuff() {} private function testMoreStuff() {} protected function testEvenMoreStuff() {} }'
Then there should be 1 scenarios

Include methods without prefix

Given the method prefix is 'my'
When I parse ' class SomeTest { public function myMethod() {} public function yourMethod() {} public function myOtherMethod() {} }'
Then there should be 2 scenarios
Then scenario 1 should have the name 'Method'
Then scenario 2 should have the name 'Other method'
Then there should be 1 methods
Then method 1 should have the name 'yourMethod'