@@ -17,18 +17,18 @@ discard block |
||
17 | 17 | |
18 | 18 | protected function setUp() |
19 | 19 | { |
20 | - if( !class_exists( '\\Neos\\Flow\\Mvc\\Routing\\UriBuilder' ) ) { |
|
21 | - $this->markTestSkipped( '\\Neos\\Flow\\Mvc\\Routing\\UriBuilder is not available' ); |
|
20 | + if (!class_exists('\\Neos\\Flow\\Mvc\\Routing\\UriBuilder')) { |
|
21 | + $this->markTestSkipped('\\Neos\\Flow\\Mvc\\Routing\\UriBuilder is not available'); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | $view = new \Aimeos\MW\View\Standard(); |
25 | 25 | |
26 | - $this->buildMock = $this->getMockbuilder( '\\Neos\\Flow\\Mvc\\Routing\\UriBuilder' ) |
|
27 | - ->setMethods( array( 'uriFor' ) ) |
|
26 | + $this->buildMock = $this->getMockbuilder('\\Neos\\Flow\\Mvc\\Routing\\UriBuilder') |
|
27 | + ->setMethods(array('uriFor')) |
|
28 | 28 | ->disableOriginalConstructor() |
29 | 29 | ->getMock(); |
30 | 30 | |
31 | - $this->object = new \Aimeos\MW\View\Helper\Url\Flow( $view, $this->buildMock, array( 'site' => 'unittest' ) ); |
|
31 | + $this->object = new \Aimeos\MW\View\Helper\Url\Flow($view, $this->buildMock, array('site' => 'unittest')); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | |
@@ -40,60 +40,60 @@ discard block |
||
40 | 40 | |
41 | 41 | public function testTransform() |
42 | 42 | { |
43 | - $this->buildMock->expects( $this->once() )->method( 'uriFor' ) |
|
44 | - ->will( $this->returnValue( '/shop/catalog/lists') ); |
|
43 | + $this->buildMock->expects($this->once())->method('uriFor') |
|
44 | + ->will($this->returnValue('/shop/catalog/lists')); |
|
45 | 45 | |
46 | - $this->assertEquals( '/shop/catalog/lists', $this->object->transform( 'shop', 'catalog', 'lists' ) ); |
|
46 | + $this->assertEquals('/shop/catalog/lists', $this->object->transform('shop', 'catalog', 'lists')); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | |
50 | 50 | public function testTransformSlashes() |
51 | 51 | { |
52 | - $this->buildMock->expects( $this->once() )->method( 'uriFor' ) |
|
53 | - ->will( $this->returnValue( '/shop/catalog/lists?test=a%2Fb') ); |
|
52 | + $this->buildMock->expects($this->once())->method('uriFor') |
|
53 | + ->will($this->returnValue('/shop/catalog/lists?test=a%2Fb')); |
|
54 | 54 | |
55 | - $this->assertEquals( '/shop/catalog/lists?test=a%2Fb', $this->object->transform( 'shop', 'catalog', 'lists', array( 'test' => 'a/b' ) ) ); |
|
55 | + $this->assertEquals('/shop/catalog/lists?test=a%2Fb', $this->object->transform('shop', 'catalog', 'lists', array('test' => 'a/b'))); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | |
59 | 59 | public function testTransformArrays() |
60 | 60 | { |
61 | - $this->buildMock->expects( $this->once() )->method( 'uriFor' ) |
|
62 | - ->will( $this->returnValue( '/shop/catalog/list?test%5B0%5D=a&test%5B1%5D=b') ); |
|
61 | + $this->buildMock->expects($this->once())->method('uriFor') |
|
62 | + ->will($this->returnValue('/shop/catalog/list?test%5B0%5D=a&test%5B1%5D=b')); |
|
63 | 63 | |
64 | - $this->assertEquals( '/shop/catalog/list?test%5B0%5D=a&test%5B1%5D=b', $this->object->transform( 'shop', 'catalog', 'lists', array( 'test' => array( 'a', 'b' ) ) ) ); |
|
64 | + $this->assertEquals('/shop/catalog/list?test%5B0%5D=a&test%5B1%5D=b', $this->object->transform('shop', 'catalog', 'lists', array('test' => array('a', 'b')))); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | |
68 | 68 | public function testTransformTrailing() |
69 | 69 | { |
70 | - $this->buildMock->expects( $this->once() )->method( 'uriFor' ) |
|
71 | - ->will( $this->returnValue( '/shop/catalog/lists#a/b') ); |
|
70 | + $this->buildMock->expects($this->once())->method('uriFor') |
|
71 | + ->will($this->returnValue('/shop/catalog/lists#a/b')); |
|
72 | 72 | |
73 | - $this->assertEquals( '/shop/catalog/lists#a/b', $this->object->transform( 'shop', 'catalog', 'lists', [], array( 'a', 'b' ) ) ); |
|
73 | + $this->assertEquals('/shop/catalog/lists#a/b', $this->object->transform('shop', 'catalog', 'lists', [], array('a', 'b'))); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | |
77 | 77 | public function testTransformAbsolute() |
78 | 78 | { |
79 | - $this->buildMock->expects( $this->once() )->method( 'uriFor' ) |
|
80 | - ->will( $this->returnValue( 'http://localhost/shop/catalog/lists') ); |
|
79 | + $this->buildMock->expects($this->once())->method('uriFor') |
|
80 | + ->will($this->returnValue('http://localhost/shop/catalog/lists')); |
|
81 | 81 | |
82 | - $options = array( 'absoluteUri' => true ); |
|
83 | - $result = $this->object->transform( 'shop', 'catalog', 'lists', [], [], $options ); |
|
82 | + $options = array('absoluteUri' => true); |
|
83 | + $result = $this->object->transform('shop', 'catalog', 'lists', [], [], $options); |
|
84 | 84 | |
85 | - $this->assertEquals( 'http://localhost/shop/catalog/lists', $result ); |
|
85 | + $this->assertEquals('http://localhost/shop/catalog/lists', $result); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | 89 | public function testTransformConfig() |
90 | 90 | { |
91 | - $this->buildMock->expects( $this->once() )->method( 'uriFor' ) |
|
92 | - ->will( $this->returnValue( '/shop/catalog/lists') ); |
|
91 | + $this->buildMock->expects($this->once())->method('uriFor') |
|
92 | + ->will($this->returnValue('/shop/catalog/lists')); |
|
93 | 93 | |
94 | - $options = array( 'package' => 'test', 'subpackage' => 'subtest', 'format' => 'fmt' ); |
|
95 | - $result = $this->object->transform( 'shop', 'catalog', 'lists', [], [], $options ); |
|
94 | + $options = array('package' => 'test', 'subpackage' => 'subtest', 'format' => 'fmt'); |
|
95 | + $result = $this->object->transform('shop', 'catalog', 'lists', [], [], $options); |
|
96 | 96 | |
97 | - $this->assertEquals( '/shop/catalog/lists', $result ); |
|
97 | + $this->assertEquals('/shop/catalog/lists', $result); |
|
98 | 98 | } |
99 | 99 | } |