@@ 33-46 (lines=14) @@ | ||
30 | /** |
|
31 | * @test |
|
32 | */ |
|
33 | public function shouldParseSimpleType() |
|
34 | { |
|
35 | //given |
|
36 | $parameter = 'int $a'; |
|
37 | $parser = new ParameterParser($parameter); |
|
38 | ||
39 | //when |
|
40 | $parser->parse(); |
|
41 | ||
42 | //then |
|
43 | $this->assertEquals('a', $parser->getName()); |
|
44 | $this->assertEquals('int', $parser->getType()); |
|
45 | $this->assertFalse($parser->isComplex()); |
|
46 | } |
|
47 | ||
48 | /** |
|
49 | * @test |
|
@@ 65-79 (lines=15) @@ | ||
62 | /** |
|
63 | * @test |
|
64 | */ |
|
65 | public function shouldParseComplexType() |
|
66 | { |
|
67 | //given |
|
68 | $parameter = 'object $object1 @string=$name @int=$id'; |
|
69 | $parser = new ParameterParser($parameter); |
|
70 | ||
71 | //when |
|
72 | $parser->parse(); |
|
73 | ||
74 | //then |
|
75 | $this->assertEquals('object1', $parser->getName()); |
|
76 | $this->assertEquals('object', $parser->getType()); |
|
77 | $this->assertTrue($parser->isComplex()); |
|
78 | $this->assertCount(2, $parser->complexTypes()); |
|
79 | } |
|
80 | ||
81 | /** |
|
82 | * @test |