@@ 40-53 (lines=14) @@ | ||
37 | $this->getFunctions()->shouldHaveAFunctionNamed('url'); |
|
38 | } |
|
39 | ||
40 | function it_uses_an_uri_generator_to_output_the_url( |
|
41 | UriGeneratorInterface $generator |
|
42 | ) |
|
43 | { |
|
44 | $generator->generate('test', []) |
|
45 | ->shouldBeCalled() |
|
46 | ->willReturn('/test'); |
|
47 | ||
48 | $this->beConstructedWith($generator); |
|
49 | ||
50 | /** @var \Twig_SimpleFunction $func */ |
|
51 | $func = $this->getFunctions()['url']; |
|
52 | call_user_func_array($func->getCallable(), ['test']); |
|
53 | } |
|
54 | ||
55 | function it_defines_a_template_function_for_css_include_tag() |
|
56 | { |
|
@@ 60-73 (lines=14) @@ | ||
57 | $this->getFunctions()->shouldHaveAFunctionNamed('addCss'); |
|
58 | } |
|
59 | ||
60 | function it_uses_an_uri_generator_to_output_the_css_url( |
|
61 | UriGeneratorInterface $generator |
|
62 | ) |
|
63 | { |
|
64 | $generator->generate('css/test.css', []) |
|
65 | ->shouldBeCalled() |
|
66 | ->willReturn('/css/test.css'); |
|
67 | ||
68 | $this->beConstructedWith($generator); |
|
69 | ||
70 | /** @var \Twig_SimpleFunction $func */ |
|
71 | $func = $this->getFunctions()['addCss']; |
|
72 | call_user_func_array($func->getCallable(), ['test.css']); |
|
73 | } |
|
74 | ||
75 | function it_defines_a_template_function_for_add_javascript_tag() |
|
76 | { |
|
@@ 80-93 (lines=14) @@ | ||
77 | $this->getFunctions()->shouldHaveAFunctionNamed('addJs'); |
|
78 | } |
|
79 | ||
80 | function it_uses_an_uri_generator_to_output_the_js_url( |
|
81 | UriGeneratorInterface $generator |
|
82 | ) |
|
83 | { |
|
84 | $generator->generate('js/test.js', []) |
|
85 | ->shouldBeCalled() |
|
86 | ->willReturn('/js/test.js'); |
|
87 | ||
88 | $this->beConstructedWith($generator); |
|
89 | ||
90 | /** @var \Twig_SimpleFunction $func */ |
|
91 | $func = $this->getFunctions()['addJs']; |
|
92 | call_user_func_array($func->getCallable(), ['test.js']); |
|
93 | } |
|
94 | ||
95 | public function getMatchers() |
|
96 | { |