@@ -16,41 +16,41 @@ |
||
16 | 16 | |
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | - if( !class_exists( '\Illuminate\View\Factory' ) ) { |
|
20 | - $this->markTestSkipped( '\Illuminate\View\Factory is not available' ); |
|
19 | + if (!class_exists('\Illuminate\View\Factory')) { |
|
20 | + $this->markTestSkipped('\Illuminate\View\Factory is not available'); |
|
21 | 21 | } |
22 | 22 | |
23 | - $this->mock = $this->getMockBuilder( '\Illuminate\View\Factory' ) |
|
24 | - ->setMethods( array( 'file' ) ) |
|
23 | + $this->mock = $this->getMockBuilder('\Illuminate\View\Factory') |
|
24 | + ->setMethods(array('file')) |
|
25 | 25 | ->disableOriginalConstructor() |
26 | 26 | ->getMock(); |
27 | 27 | |
28 | - $this->object = new \Aimeos\MW\View\Engine\Blade( $this->mock ); |
|
28 | + $this->object = new \Aimeos\MW\View\Engine\Blade($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( array() ); |
|
40 | + $v = new \Aimeos\MW\View\Standard(array()); |
|
41 | 41 | |
42 | - $view = $this->getMockBuilder( '\Illuminate\View\View' ) |
|
43 | - ->setMethods( array( 'render' ) ) |
|
42 | + $view = $this->getMockBuilder('\Illuminate\View\View') |
|
43 | + ->setMethods(array('render')) |
|
44 | 44 | ->disableOriginalConstructor() |
45 | 45 | ->getMock(); |
46 | 46 | |
47 | - $view->expects( $this->once() )->method( 'render' ) |
|
48 | - ->will( $this->returnValue( 'test' ) ); |
|
47 | + $view->expects($this->once())->method('render') |
|
48 | + ->will($this->returnValue('test')); |
|
49 | 49 | |
50 | - $this->mock->expects( $this->once() )->method( 'file' ) |
|
51 | - ->will( $this->returnValue( $view) ); |
|
50 | + $this->mock->expects($this->once())->method('file') |
|
51 | + ->will($this->returnValue($view)); |
|
52 | 52 | |
53 | - $result = $this->object->render( $v, 'filepath', array( 'key' => 'value' ) ); |
|
54 | - $this->assertEquals( 'test', $result ); |
|
53 | + $result = $this->object->render($v, 'filepath', array('key' => 'value')); |
|
54 | + $this->assertEquals('test', $result); |
|
55 | 55 | } |
56 | 56 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * |
28 | 28 | * @param \Illuminate\View\Factory $factory Laravel view factory |
29 | 29 | */ |
30 | - public function __construct( \Illuminate\View\Factory $factory ) |
|
30 | + public function __construct(\Illuminate\View\Factory $factory) |
|
31 | 31 | { |
32 | 32 | $this->factory = $factory; |
33 | 33 | } |
@@ -42,18 +42,18 @@ discard block |
||
42 | 42 | * @return string Output generated by the template |
43 | 43 | * @throws \Aimeos\MW\View\Exception If the template isn't found |
44 | 44 | */ |
45 | - public function render( \Aimeos\MW\View\Iface $view, $filename, array $values ) |
|
45 | + public function render(\Aimeos\MW\View\Iface $view, $filename, array $values) |
|
46 | 46 | { |
47 | - $lv = $this->factory->file( $filename, $values ); |
|
47 | + $lv = $this->factory->file($filename, $values); |
|
48 | 48 | |
49 | - $fcn = function( $lv, $contents ) use ( $view ) |
|
49 | + $fcn = function($lv, $contents) use ($view) |
|
50 | 50 | { |
51 | - foreach( $this->factory->getSections() as $name => $section ) { |
|
52 | - $view->block()->set( $name, $section ); |
|
51 | + foreach ($this->factory->getSections() as $name => $section) { |
|
52 | + $view->block()->set($name, $section); |
|
53 | 53 | } |
54 | 54 | }; |
55 | 55 | |
56 | - $contents = $lv->render( $fcn ); |
|
56 | + $contents = $lv->render($fcn); |
|
57 | 57 | $this->factory->flushSections(); |
58 | 58 | |
59 | 59 | return $contents; |