@@ -16,60 +16,60 @@ |
||
16 | 16 | |
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | - if( !class_exists( '\Twig_Environment' ) ) { |
|
20 | - $this->markTestSkipped( 'Twig_Environment is not available' ); |
|
19 | + if (!class_exists('\Twig_Environment')) { |
|
20 | + $this->markTestSkipped('Twig_Environment is not available'); |
|
21 | 21 | } |
22 | 22 | |
23 | - $this->mock = $this->getMockBuilder( '\Twig_Environment' ) |
|
24 | - ->setMethods( array( 'getExtensions', 'getLoader', 'loadTemplate' ) ) |
|
23 | + $this->mock = $this->getMockBuilder('\Twig_Environment') |
|
24 | + ->setMethods(array('getExtensions', 'getLoader', 'loadTemplate')) |
|
25 | 25 | ->disableOriginalConstructor() |
26 | 26 | ->getMock(); |
27 | 27 | |
28 | - $this->object = new \Aimeos\MW\View\Engine\Twig( $this->mock ); |
|
28 | + $this->object = new \Aimeos\MW\View\Engine\Twig($this->mock); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | |
32 | 32 | protected function tearDown() |
33 | 33 | { |
34 | - unset( $this->object, $this->mock ); |
|
34 | + unset($this->object, $this->mock); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | 38 | public function testRender() |
39 | 39 | { |
40 | - $v = new \Aimeos\MW\View\Standard( [] ); |
|
40 | + $v = new \Aimeos\MW\View\Standard([]); |
|
41 | 41 | |
42 | - $this->mock->expects( $this->once() )->method( 'getExtensions' ) |
|
43 | - ->will( $this->returnValue( array( [] ) ) ); |
|
42 | + $this->mock->expects($this->once())->method('getExtensions') |
|
43 | + ->will($this->returnValue(array([]))); |
|
44 | 44 | |
45 | 45 | |
46 | - $view = $this->getMockBuilder( '\Twig_Template' ) |
|
47 | - ->setConstructorArgs( array ( $this->mock ) ) |
|
48 | - ->setMethods( array( 'getBlockNames', 'render', 'renderBlock' ) ) |
|
46 | + $view = $this->getMockBuilder('\Twig_Template') |
|
47 | + ->setConstructorArgs(array($this->mock)) |
|
48 | + ->setMethods(array('getBlockNames', 'render', 'renderBlock')) |
|
49 | 49 | ->getMockForAbstractClass(); |
50 | 50 | |
51 | - $view->expects( $this->once() )->method( 'getBlockNames' ) |
|
52 | - ->will( $this->returnValue( array( 'testblock' ) ) ); |
|
51 | + $view->expects($this->once())->method('getBlockNames') |
|
52 | + ->will($this->returnValue(array('testblock'))); |
|
53 | 53 | |
54 | - $view->expects( $this->once() )->method( 'renderBlock' ) |
|
55 | - ->will( $this->returnValue( 'block content' ) ); |
|
54 | + $view->expects($this->once())->method('renderBlock') |
|
55 | + ->will($this->returnValue('block content')); |
|
56 | 56 | |
57 | - $view->expects( $this->once() )->method( 'render' ) |
|
58 | - ->will( $this->returnValue( 'test' ) ); |
|
57 | + $view->expects($this->once())->method('render') |
|
58 | + ->will($this->returnValue('test')); |
|
59 | 59 | |
60 | 60 | |
61 | - $loader = $this->getMockBuilder( '\Twig_LoaderInterface' ) |
|
61 | + $loader = $this->getMockBuilder('\Twig_LoaderInterface') |
|
62 | 62 | ->disableOriginalConstructor() |
63 | 63 | ->getMockForAbstractClass(); |
64 | 64 | |
65 | - $this->mock->expects( $this->once() )->method( 'getLoader' ) |
|
66 | - ->will( $this->returnValue( $loader) ); |
|
65 | + $this->mock->expects($this->once())->method('getLoader') |
|
66 | + ->will($this->returnValue($loader)); |
|
67 | 67 | |
68 | - $this->mock->expects( $this->once() )->method( 'loadTemplate' ) |
|
69 | - ->will( $this->returnValue( $view) ); |
|
68 | + $this->mock->expects($this->once())->method('loadTemplate') |
|
69 | + ->will($this->returnValue($view)); |
|
70 | 70 | |
71 | 71 | |
72 | - $result = $this->object->render( $v, __FILE__, array( 'key' => 'value' ) ); |
|
73 | - $this->assertEquals( 'test', $result ); |
|
72 | + $result = $this->object->render($v, __FILE__, array('key' => 'value')); |
|
73 | + $this->assertEquals('test', $result); |
|
74 | 74 | } |
75 | 75 | } |