This repository was archived by the owner on Feb 14, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
spec/PhpSpec/Symfony2Extension/Locator
src/PhpSpec/Symfony2Extension/Locator Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -49,12 +49,26 @@ function it_generates_the_src_namespace_from_provided_parts_using_the_locator(Lo
49
49
$ this ->getSrcNamespace ()->shouldReturn ('Local \\Acme \\Bundle \\DemoBundle \\Model ' );
50
50
}
51
51
52
- function it_generates_proper_src_namespace_even_if_there_is_only_one_part (Locator $ locator )
52
+ function it_generates_a_proper_src_namespace_even_if_there_is_only_one_part (Locator $ locator )
53
53
{
54
54
$ this ->beConstructedWith (array ('config ' ), $ locator );
55
55
56
56
$ locator ->getSrcNamespace ()->willReturn ('Local \\' );
57
57
58
58
$ this ->getSrcNamespace ()->shouldReturn ('Local ' );
59
59
}
60
+
61
+ function it_generates_the_src_classname_from_provided_parts_using_the_locator (Locator $ locator )
62
+ {
63
+ $ locator ->getSrcNamespace ()->willReturn ('Local \\' );
64
+
65
+ $ this ->getSrcClassname ()->shouldReturn ('Local \\Acme \\Bundle \\DemoBundle \\Model \\User ' );
66
+ }
67
+
68
+ function it_generates_a_proper_src_classname_for_an_empty_locator_namespace (Locator $ locator )
69
+ {
70
+ $ locator ->getSrcNamespace ()->willReturn ('' );
71
+
72
+ $ this ->getSrcClassname ()->shouldReturn ('Acme \\Bundle \\DemoBundle \\Model \\User ' );
73
+ }
60
74
}
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ public function getSrcNamespace()
52
52
53
53
public function getSrcClassname ()
54
54
{
55
- // @todo: Implement getSrcClassname() method.
55
+ return $ this -> locator -> getSrcNamespace (). implode ( '\\' , $ this -> parts );
56
56
}
57
57
58
58
public function getSpecFilename ()
You can’t perform that action at this time.
0 commit comments