@@ -26,48 +26,48 @@ discard block |
||
26 | 26 | */ |
27 | 27 | protected function setUp() |
28 | 28 | { |
29 | - if( !class_exists( '\\TYPO3\\Flow\\Mvc\\Routing\\UriBuilder' ) ) { |
|
30 | - $this->markTestSkipped( '\\TYPO3\\Flow\\Mvc\\Routing\\UriBuilder is not available' ); |
|
29 | + if (!class_exists('\\TYPO3\\Flow\\Mvc\\Routing\\UriBuilder')) { |
|
30 | + $this->markTestSkipped('\\TYPO3\\Flow\\Mvc\\Routing\\UriBuilder is not available'); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | $view = new \Aimeos\MW\View\Standard(); |
34 | 34 | |
35 | - $mockHttpRequest = $this->getMockBuilder( 'TYPO3\Flow\Http\Request' ) |
|
36 | - ->setMethods( array( 'getBaseUri' ) ) |
|
35 | + $mockHttpRequest = $this->getMockBuilder('TYPO3\Flow\Http\Request') |
|
36 | + ->setMethods(array('getBaseUri')) |
|
37 | 37 | ->disableOriginalConstructor() |
38 | 38 | ->getMock(); |
39 | - $mockHttpRequest->expects( $this->any() ) |
|
40 | - ->method( 'getBaseUri' ) |
|
41 | - ->will( $this->returnValue( 'http://localhost/' ) ); |
|
39 | + $mockHttpRequest->expects($this->any()) |
|
40 | + ->method('getBaseUri') |
|
41 | + ->will($this->returnValue('http://localhost/')); |
|
42 | 42 | |
43 | - $mockMainRequest = $this->getMockBuilder( 'TYPO3\Flow\Mvc\ActionRequest' ) |
|
44 | - ->setMethods( array( 'getControllerObjectName', 'getArgumentNamespace' ) ) |
|
45 | - ->setConstructorArgs( array( $mockHttpRequest ) ) |
|
43 | + $mockMainRequest = $this->getMockBuilder('TYPO3\Flow\Mvc\ActionRequest') |
|
44 | + ->setMethods(array('getControllerObjectName', 'getArgumentNamespace')) |
|
45 | + ->setConstructorArgs(array($mockHttpRequest)) |
|
46 | 46 | ->getMock(); |
47 | - $mockMainRequest->expects( $this->any() ) |
|
48 | - ->method( 'getArgumentNamespace' ) |
|
49 | - ->will( $this->returnValue( 'ai' ) ); |
|
47 | + $mockMainRequest->expects($this->any()) |
|
48 | + ->method('getArgumentNamespace') |
|
49 | + ->will($this->returnValue('ai')); |
|
50 | 50 | |
51 | - $this->mockRouter = $this->getMockBuilder( 'TYPO3\Flow\Mvc\Routing\Router' )->getMock(); |
|
52 | - $mockEnv = $this->getMockBuilder( 'TYPO3\Flow\Utility\Environment' ) |
|
53 | - ->setMethods( array( 'isRewriteEnabled' ) ) |
|
51 | + $this->mockRouter = $this->getMockBuilder('TYPO3\Flow\Mvc\Routing\Router')->getMock(); |
|
52 | + $mockEnv = $this->getMockBuilder('TYPO3\Flow\Utility\Environment') |
|
53 | + ->setMethods(array('isRewriteEnabled')) |
|
54 | 54 | ->disableOriginalConstructor() |
55 | 55 | ->getMock(); |
56 | 56 | |
57 | 57 | $builder = new \TYPO3\Flow\Mvc\Routing\UriBuilder(); |
58 | - $builder->setRequest( $mockMainRequest ); |
|
58 | + $builder->setRequest($mockMainRequest); |
|
59 | 59 | |
60 | - $objectReflection = new \ReflectionObject( $builder ); |
|
60 | + $objectReflection = new \ReflectionObject($builder); |
|
61 | 61 | |
62 | - $property = $objectReflection->getProperty( 'router' ); |
|
63 | - $property->setAccessible( true ); |
|
64 | - $property->setValue( $builder, $this->mockRouter ); |
|
62 | + $property = $objectReflection->getProperty('router'); |
|
63 | + $property->setAccessible(true); |
|
64 | + $property->setValue($builder, $this->mockRouter); |
|
65 | 65 | |
66 | - $property = $objectReflection->getProperty( 'environment' ); |
|
67 | - $property->setAccessible( true ); |
|
68 | - $property->setValue( $builder, $mockEnv ); |
|
66 | + $property = $objectReflection->getProperty('environment'); |
|
67 | + $property->setAccessible(true); |
|
68 | + $property->setValue($builder, $mockEnv); |
|
69 | 69 | |
70 | - $this->object = new \Aimeos\MW\View\Helper\Url\Flow( $view, $builder, array( 'site' => 'unittest' ) ); |
|
70 | + $this->object = new \Aimeos\MW\View\Helper\Url\Flow($view, $builder, array('site' => 'unittest')); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | |
@@ -85,60 +85,60 @@ discard block |
||
85 | 85 | |
86 | 86 | public function testTransform() |
87 | 87 | { |
88 | - $this->mockRouter->expects( $this->once() )->method( 'resolve' ) |
|
89 | - ->will( $this->returnValue( 'shop/catalog/lists') ); |
|
88 | + $this->mockRouter->expects($this->once())->method('resolve') |
|
89 | + ->will($this->returnValue('shop/catalog/lists')); |
|
90 | 90 | |
91 | - $this->assertEquals( '/index.php/shop/catalog/lists', $this->object->transform( 'shop', 'catalog', 'lists' ) ); |
|
91 | + $this->assertEquals('/index.php/shop/catalog/lists', $this->object->transform('shop', 'catalog', 'lists')); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | |
95 | 95 | public function testTransformSlashes() |
96 | 96 | { |
97 | - $this->mockRouter->expects( $this->once() )->method( 'resolve' ) |
|
98 | - ->will( $this->returnValue( 'shop/catalog/lists?test=a%2Fb') ); |
|
97 | + $this->mockRouter->expects($this->once())->method('resolve') |
|
98 | + ->will($this->returnValue('shop/catalog/lists?test=a%2Fb')); |
|
99 | 99 | |
100 | - $this->assertEquals( '/index.php/shop/catalog/lists?test=a%2Fb', $this->object->transform( 'shop', 'catalog', 'lists', array( 'test' => 'a/b' ) ) ); |
|
100 | + $this->assertEquals('/index.php/shop/catalog/lists?test=a%2Fb', $this->object->transform('shop', 'catalog', 'lists', array('test' => 'a/b'))); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | |
104 | 104 | public function testTransformArrays() |
105 | 105 | { |
106 | - $this->mockRouter->expects( $this->once() )->method( 'resolve' ) |
|
107 | - ->will( $this->returnValue( 'shop/catalog/list?test%5B0%5D=a&test%5B1%5D=b') ); |
|
106 | + $this->mockRouter->expects($this->once())->method('resolve') |
|
107 | + ->will($this->returnValue('shop/catalog/list?test%5B0%5D=a&test%5B1%5D=b')); |
|
108 | 108 | |
109 | - $this->assertEquals( '/index.php/shop/catalog/list?test%5B0%5D=a&test%5B1%5D=b', $this->object->transform( 'shop', 'catalog', 'lists', array( 'test' => array( 'a', 'b' ) ) ) ); |
|
109 | + $this->assertEquals('/index.php/shop/catalog/list?test%5B0%5D=a&test%5B1%5D=b', $this->object->transform('shop', 'catalog', 'lists', array('test' => array('a', 'b')))); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | |
113 | 113 | public function testTransformTrailing() |
114 | 114 | { |
115 | - $this->mockRouter->expects( $this->once() )->method( 'resolve' ) |
|
116 | - ->will( $this->returnValue( 'shop/catalog/lists') ); |
|
115 | + $this->mockRouter->expects($this->once())->method('resolve') |
|
116 | + ->will($this->returnValue('shop/catalog/lists')); |
|
117 | 117 | |
118 | - $this->assertEquals( '/index.php/shop/catalog/lists#a/b', $this->object->transform( 'shop', 'catalog', 'lists', array(), array( 'a', 'b' ) ) ); |
|
118 | + $this->assertEquals('/index.php/shop/catalog/lists#a/b', $this->object->transform('shop', 'catalog', 'lists', array(), array('a', 'b'))); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | |
122 | 122 | public function testTransformAbsolute() |
123 | 123 | { |
124 | - $this->mockRouter->expects( $this->once() )->method( 'resolve' ) |
|
125 | - ->will( $this->returnValue( 'shop/catalog/lists') ); |
|
124 | + $this->mockRouter->expects($this->once())->method('resolve') |
|
125 | + ->will($this->returnValue('shop/catalog/lists')); |
|
126 | 126 | |
127 | - $options = array( 'absoluteUri' => true ); |
|
128 | - $result = $this->object->transform( 'shop', 'catalog', 'lists', array(), array(), $options ); |
|
127 | + $options = array('absoluteUri' => true); |
|
128 | + $result = $this->object->transform('shop', 'catalog', 'lists', array(), array(), $options); |
|
129 | 129 | |
130 | - $this->assertEquals( 'http://localhost/index.php/shop/catalog/lists', $result ); |
|
130 | + $this->assertEquals('http://localhost/index.php/shop/catalog/lists', $result); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | |
134 | 134 | public function testTransformConfig() |
135 | 135 | { |
136 | - $this->mockRouter->expects( $this->once() )->method( 'resolve' ) |
|
137 | - ->will( $this->returnValue( 'shop/catalog/lists') ); |
|
136 | + $this->mockRouter->expects($this->once())->method('resolve') |
|
137 | + ->will($this->returnValue('shop/catalog/lists')); |
|
138 | 138 | |
139 | - $options = array( 'package' => 'test', 'subpackage' => 'subtest', 'format' => 'fmt' ); |
|
140 | - $result = $this->object->transform( 'shop', 'catalog', 'lists', array(), array(), $options ); |
|
139 | + $options = array('package' => 'test', 'subpackage' => 'subtest', 'format' => 'fmt'); |
|
140 | + $result = $this->object->transform('shop', 'catalog', 'lists', array(), array(), $options); |
|
141 | 141 | |
142 | - $this->assertEquals( '/index.php/shop/catalog/lists', $result ); |
|
142 | + $this->assertEquals('/index.php/shop/catalog/lists', $result); |
|
143 | 143 | } |
144 | 144 | } |