|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace spec\Knp\RadBundle\Twig; |
|
4
|
|
|
|
|
5
|
|
|
use PhpSpec\ObjectBehavior; |
|
6
|
|
|
|
|
7
|
|
|
class FlashesNodeSpec extends ObjectBehavior |
|
8
|
|
|
{ |
|
9
|
|
|
/** |
|
10
|
|
|
* @param Twig_Node_Expression $types |
|
11
|
|
|
* @param Twig_Node_Expression $catalog |
|
12
|
|
|
* @param Twig_NodeInterface $body |
|
13
|
|
|
*/ |
|
14
|
|
|
function let($types, $catalog, $body) |
|
15
|
|
|
{ |
|
16
|
|
|
$this->beConstructedWith($types, $catalog, $body, 123); |
|
17
|
|
|
} |
|
18
|
|
|
|
|
19
|
|
|
function it_should_be_a_twig_node() |
|
|
|
|
|
|
20
|
|
|
{ |
|
21
|
|
|
$this->shouldBeAnInstanceOf('Twig_Node'); |
|
22
|
|
|
} |
|
23
|
|
|
|
|
24
|
|
|
function it_should_be_constructible_with_no_types($catalog, $body) |
|
|
|
|
|
|
25
|
|
|
{ |
|
26
|
|
|
$this->shouldNotThrow()->during('__construct', array(null, $catalog, $body, 123)); |
|
27
|
|
|
} |
|
28
|
|
|
|
|
29
|
|
|
function it_should_be_constructible_with_no_catalog($types, $body) |
|
|
|
|
|
|
30
|
|
|
{ |
|
31
|
|
|
$this->shouldNotThrow()->during('__construct', array($types, null, $body, 123)); |
|
32
|
|
|
} |
|
33
|
|
|
|
|
34
|
|
|
/** |
|
35
|
|
|
* @param Twig_Compiler $compiler |
|
36
|
|
|
*/ |
|
37
|
|
|
function it_should_compile($compiler, $types, $catalog, $body) |
|
|
|
|
|
|
38
|
|
|
{ |
|
39
|
|
|
$compiler->addDebugInfo($this)->shouldBeCalled()->willReturn($compiler); |
|
40
|
|
|
$compiler->subcompile($types)->shouldBeCalled()->willReturn($compiler); |
|
41
|
|
|
$compiler->subcompile($catalog)->shouldBeCalled()->willReturn($compiler); |
|
42
|
|
|
$compiler->subcompile($body)->shouldBeCalled()->willReturn($compiler); |
|
43
|
|
|
|
|
44
|
|
|
$compiler->write(\Prophecy\Argument::cetera())->willReturn($compiler); |
|
45
|
|
|
$compiler->raw(\Prophecy\Argument::cetera())->willReturn($compiler); |
|
46
|
|
|
$compiler->indent(\Prophecy\Argument::cetera())->willReturn($compiler); |
|
47
|
|
|
$compiler->outdent(\Prophecy\Argument::cetera())->willReturn($compiler); |
|
48
|
|
|
|
|
49
|
|
|
$this->compile($compiler); |
|
50
|
|
|
} |
|
51
|
|
|
} |
|
52
|
|
|
|