@@ -21,12 +21,12 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | protected function setUp() |
| 23 | 23 | { |
| 24 | - if( interface_exists( 'TYPO3\Flow\Cache\Frontend\FrontendInterface' ) === false ) { |
|
| 25 | - $this->markTestSkipped( 'Class \\TYPO3\\Flow\\Cache\\Frontend\\FrontendInterface not found' ); |
|
| 24 | + if (interface_exists('TYPO3\Flow\Cache\Frontend\FrontendInterface') === false) { |
|
| 25 | + $this->markTestSkipped('Class \\TYPO3\\Flow\\Cache\\Frontend\\FrontendInterface not found'); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - $this->mock = $this->getMockBuilder( 'TYPO3\Flow\Cache\Frontend\FrontendInterface' )->getMock(); |
|
| 29 | - $this->object = new \Aimeos\MW\Cache\Flow( array(), $this->mock ); |
|
| 28 | + $this->mock = $this->getMockBuilder('TYPO3\Flow\Cache\Frontend\FrontendInterface')->getMock(); |
|
| 29 | + $this->object = new \Aimeos\MW\Cache\Flow(array(), $this->mock); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
@@ -38,190 +38,190 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | protected function tearDown() |
| 40 | 40 | { |
| 41 | - unset( $this->mock, $this->object ); |
|
| 41 | + unset($this->mock, $this->object); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | |
| 45 | 45 | public function testDelete() |
| 46 | 46 | { |
| 47 | - $this->mock->expects( $this->once() )->method( 'remove' )->with( $this->equalTo( 'key' ) ); |
|
| 48 | - $this->object->delete( 'key' ); |
|
| 47 | + $this->mock->expects($this->once())->method('remove')->with($this->equalTo('key')); |
|
| 48 | + $this->object->delete('key'); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
| 52 | 52 | public function testDeleteWithSiteId() |
| 53 | 53 | { |
| 54 | - $object = new \Aimeos\MW\Cache\Flow( array( 'siteid' => 1 ), $this->mock ); |
|
| 54 | + $object = new \Aimeos\MW\Cache\Flow(array('siteid' => 1), $this->mock); |
|
| 55 | 55 | |
| 56 | - $this->mock->expects( $this->once() )->method( 'remove' )->with( $this->equalTo( '1-key' ) ); |
|
| 57 | - $object->delete( 'key' ); |
|
| 56 | + $this->mock->expects($this->once())->method('remove')->with($this->equalTo('1-key')); |
|
| 57 | + $object->delete('key'); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | |
| 61 | 61 | public function testDeleteList() |
| 62 | 62 | { |
| 63 | - $this->mock->expects( $this->exactly( 2 ) )->method( 'remove' )->with( $this->equalTo( 'key' ) ); |
|
| 64 | - $this->object->deleteList( array( 'key', 'key' ) ); |
|
| 63 | + $this->mock->expects($this->exactly(2))->method('remove')->with($this->equalTo('key')); |
|
| 64 | + $this->object->deleteList(array('key', 'key')); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | |
| 68 | 68 | public function testDeleteListWithSiteId() |
| 69 | 69 | { |
| 70 | - $object = new \Aimeos\MW\Cache\Flow( array( 'siteid' => 1 ), $this->mock ); |
|
| 70 | + $object = new \Aimeos\MW\Cache\Flow(array('siteid' => 1), $this->mock); |
|
| 71 | 71 | |
| 72 | - $this->mock->expects( $this->once() )->method( 'remove' )->with( $this->equalTo( '1-key' ) ); |
|
| 73 | - $object->deleteList( array( 'key' ) ); |
|
| 72 | + $this->mock->expects($this->once())->method('remove')->with($this->equalTo('1-key')); |
|
| 73 | + $object->deleteList(array('key')); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | |
| 77 | 77 | public function testDeleteByTags() |
| 78 | 78 | { |
| 79 | - $this->mock->expects( $this->exactly( 2 ) )->method( 'flushByTag' )->with( $this->equalTo( 'tag' ) ); |
|
| 80 | - $this->object->deleteByTags( array( 'tag', 'tag' ) ); |
|
| 79 | + $this->mock->expects($this->exactly(2))->method('flushByTag')->with($this->equalTo('tag')); |
|
| 80 | + $this->object->deleteByTags(array('tag', 'tag')); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | |
| 84 | 84 | public function testDeleteByTagsWithSiteId() |
| 85 | 85 | { |
| 86 | - $object = new \Aimeos\MW\Cache\Flow( array( 'siteid' => 1 ), $this->mock ); |
|
| 86 | + $object = new \Aimeos\MW\Cache\Flow(array('siteid' => 1), $this->mock); |
|
| 87 | 87 | |
| 88 | - $this->mock->expects( $this->once() )->method( 'flushByTag' )->with( $this->equalTo( '1-tag' ) ); |
|
| 89 | - $object->deleteByTags( array( 'tag' ) ); |
|
| 88 | + $this->mock->expects($this->once())->method('flushByTag')->with($this->equalTo('1-tag')); |
|
| 89 | + $object->deleteByTags(array('tag')); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | |
| 93 | 93 | public function testFlush() |
| 94 | 94 | { |
| 95 | - $this->mock->expects( $this->once() )->method( 'flush' ); |
|
| 95 | + $this->mock->expects($this->once())->method('flush'); |
|
| 96 | 96 | $this->object->flush(); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | |
| 100 | 100 | public function testFlushWithSiteId() |
| 101 | 101 | { |
| 102 | - $object = new \Aimeos\MW\Cache\Flow( array( 'siteid' => 1 ), $this->mock ); |
|
| 102 | + $object = new \Aimeos\MW\Cache\Flow(array('siteid' => 1), $this->mock); |
|
| 103 | 103 | |
| 104 | - $this->mock->expects( $this->once() )->method( 'flushByTag' )->with( $this->equalTo( '1-siteid' ) ); |
|
| 104 | + $this->mock->expects($this->once())->method('flushByTag')->with($this->equalTo('1-siteid')); |
|
| 105 | 105 | $object->flush(); |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | |
| 109 | 109 | public function testGet() |
| 110 | 110 | { |
| 111 | - $this->mock->expects( $this->once() )->method( 'get' ) |
|
| 112 | - ->with( $this->equalTo( 'key' ) )->will( $this->returnValue( 'value' ) ); |
|
| 111 | + $this->mock->expects($this->once())->method('get') |
|
| 112 | + ->with($this->equalTo('key'))->will($this->returnValue('value')); |
|
| 113 | 113 | |
| 114 | - $this->assertEquals( 'value', $this->object->get( 'key', 'default' ) ); |
|
| 114 | + $this->assertEquals('value', $this->object->get('key', 'default')); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | |
| 118 | 118 | public function testGetDefault() |
| 119 | 119 | { |
| 120 | - $this->mock->expects( $this->once() )->method( 'get' ) |
|
| 121 | - ->with( $this->equalTo( 'key' ) )->will( $this->returnValue( false ) ); |
|
| 120 | + $this->mock->expects($this->once())->method('get') |
|
| 121 | + ->with($this->equalTo('key'))->will($this->returnValue(false)); |
|
| 122 | 122 | |
| 123 | - $this->assertEquals( 'default', $this->object->get( 'key', 'default' ) ); |
|
| 123 | + $this->assertEquals('default', $this->object->get('key', 'default')); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | |
| 127 | 127 | public function testGetWithSiteId() |
| 128 | 128 | { |
| 129 | - $object = new \Aimeos\MW\Cache\Flow( array( 'siteid' => 1 ), $this->mock ); |
|
| 129 | + $object = new \Aimeos\MW\Cache\Flow(array('siteid' => 1), $this->mock); |
|
| 130 | 130 | |
| 131 | - $this->mock->expects( $this->once() )->method( 'get' )->with( $this->equalTo( '1-key' ) ); |
|
| 132 | - $object->get( 'key', 'default' ); |
|
| 131 | + $this->mock->expects($this->once())->method('get')->with($this->equalTo('1-key')); |
|
| 132 | + $object->get('key', 'default'); |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | |
| 136 | 136 | public function testGetList() |
| 137 | 137 | { |
| 138 | - $this->mock->expects( $this->exactly( 2 ) )->method( 'get' ) |
|
| 139 | - ->will( $this->returnValue( 'value' ) ); |
|
| 138 | + $this->mock->expects($this->exactly(2))->method('get') |
|
| 139 | + ->will($this->returnValue('value')); |
|
| 140 | 140 | |
| 141 | - $expected = array( 'key1' => 'value', 'key2' => 'value' ); |
|
| 142 | - $this->assertEquals( $expected, $this->object->getList( array( 'key1', 'key2' ) ) ); |
|
| 141 | + $expected = array('key1' => 'value', 'key2' => 'value'); |
|
| 142 | + $this->assertEquals($expected, $this->object->getList(array('key1', 'key2'))); |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | |
| 146 | 146 | public function testGetListWithSiteId() |
| 147 | 147 | { |
| 148 | - $object = new \Aimeos\MW\Cache\Flow( array( 'siteid' => 1 ), $this->mock ); |
|
| 148 | + $object = new \Aimeos\MW\Cache\Flow(array('siteid' => 1), $this->mock); |
|
| 149 | 149 | |
| 150 | - $this->mock->expects( $this->once() )->method( 'get' )->with( $this->equalTo( '1-key' ) ); |
|
| 151 | - $object->getList( array( 'key' ) ); |
|
| 150 | + $this->mock->expects($this->once())->method('get')->with($this->equalTo('1-key')); |
|
| 151 | + $object->getList(array('key')); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | |
| 155 | 155 | public function testGetListByTags() |
| 156 | 156 | { |
| 157 | - $this->mock->expects( $this->exactly( 2 ) )->method( 'getByTag' ) |
|
| 158 | - ->with( $this->equalTo( 'key' ) )->will( $this->returnValue( array( 'key' => 'value' ) ) ); |
|
| 157 | + $this->mock->expects($this->exactly(2))->method('getByTag') |
|
| 158 | + ->with($this->equalTo('key'))->will($this->returnValue(array('key' => 'value'))); |
|
| 159 | 159 | |
| 160 | - $this->assertEquals( array( 'key' => 'value' ), $this->object->getListByTags( array( 'key', 'key' ) ) ); |
|
| 160 | + $this->assertEquals(array('key' => 'value'), $this->object->getListByTags(array('key', 'key'))); |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | |
| 164 | 164 | public function testGetListByTagsWithSiteId() |
| 165 | 165 | { |
| 166 | - $object = new \Aimeos\MW\Cache\Flow( array( 'siteid' => 1 ), $this->mock ); |
|
| 166 | + $object = new \Aimeos\MW\Cache\Flow(array('siteid' => 1), $this->mock); |
|
| 167 | 167 | |
| 168 | - $this->mock->expects( $this->once() )->method( 'getByTag' ) |
|
| 169 | - ->with( $this->equalTo( '1-key' ) )->will( $this->returnValue( array( '1-key' => 'value' ) ) ); |
|
| 168 | + $this->mock->expects($this->once())->method('getByTag') |
|
| 169 | + ->with($this->equalTo('1-key'))->will($this->returnValue(array('1-key' => 'value'))); |
|
| 170 | 170 | |
| 171 | - $this->assertEquals( array( 'key' => 'value' ), $object->getListByTags( array( 'key' ) ) ); |
|
| 171 | + $this->assertEquals(array('key' => 'value'), $object->getListByTags(array('key'))); |
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | |
| 175 | 175 | public function testSet() |
| 176 | 176 | { |
| 177 | - $this->mock->expects( $this->once() )->method( 'set' ) |
|
| 177 | + $this->mock->expects($this->once())->method('set') |
|
| 178 | 178 | ->with( |
| 179 | - $this->equalTo( 'key' ), $this->equalTo( 'value' ), |
|
| 180 | - $this->equalTo( array( 'tag' ) ), $this->greaterThan( 0 ) |
|
| 179 | + $this->equalTo('key'), $this->equalTo('value'), |
|
| 180 | + $this->equalTo(array('tag')), $this->greaterThan(0) |
|
| 181 | 181 | ); |
| 182 | 182 | |
| 183 | - $this->object->set( 'key', 'value', array( 'tag' ), '2000-01-01 00:00:00' ); |
|
| 183 | + $this->object->set('key', 'value', array('tag'), '2000-01-01 00:00:00'); |
|
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | |
| 187 | 187 | public function testSetWithSiteId() |
| 188 | 188 | { |
| 189 | - $object = new \Aimeos\MW\Cache\Flow( array( 'siteid' => 1 ), $this->mock ); |
|
| 189 | + $object = new \Aimeos\MW\Cache\Flow(array('siteid' => 1), $this->mock); |
|
| 190 | 190 | |
| 191 | - $this->mock->expects( $this->once() )->method( 'set' ) |
|
| 191 | + $this->mock->expects($this->once())->method('set') |
|
| 192 | 192 | ->with( |
| 193 | - $this->equalTo( '1-key' ), $this->equalTo( 'value' ), |
|
| 194 | - $this->equalTo( array( '1-siteid', '1-tag' ) ), $this->equalTo( null ) |
|
| 193 | + $this->equalTo('1-key'), $this->equalTo('value'), |
|
| 194 | + $this->equalTo(array('1-siteid', '1-tag')), $this->equalTo(null) |
|
| 195 | 195 | ); |
| 196 | 196 | |
| 197 | - $object->set( 'key', 'value', array( 'tag' ), null ); |
|
| 197 | + $object->set('key', 'value', array('tag'), null); |
|
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | |
| 201 | 201 | public function testSetList() |
| 202 | 202 | { |
| 203 | - $this->mock->expects( $this->once() )->method( 'set' ) |
|
| 203 | + $this->mock->expects($this->once())->method('set') |
|
| 204 | 204 | ->with( |
| 205 | - $this->equalTo( 'key' ), $this->equalTo( 'value' ), |
|
| 206 | - $this->equalTo( array( 'tag' ) ), $this->greaterThan( 0 ) |
|
| 205 | + $this->equalTo('key'), $this->equalTo('value'), |
|
| 206 | + $this->equalTo(array('tag')), $this->greaterThan(0) |
|
| 207 | 207 | ); |
| 208 | 208 | |
| 209 | - $expires = array( 'key' => '2000-01-01 00:00:00' ); |
|
| 210 | - $this->object->setList( array( 'key' => 'value' ), array( 'key' => array( 'tag' ) ), $expires ); |
|
| 209 | + $expires = array('key' => '2000-01-01 00:00:00'); |
|
| 210 | + $this->object->setList(array('key' => 'value'), array('key' => array('tag')), $expires); |
|
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | |
| 214 | 214 | public function testSetListWithSiteId() |
| 215 | 215 | { |
| 216 | - $object = new \Aimeos\MW\Cache\Flow( array( 'siteid' => 1 ), $this->mock ); |
|
| 216 | + $object = new \Aimeos\MW\Cache\Flow(array('siteid' => 1), $this->mock); |
|
| 217 | 217 | |
| 218 | - $this->mock->expects( $this->once() )->method( 'set' ) |
|
| 218 | + $this->mock->expects($this->once())->method('set') |
|
| 219 | 219 | ->with( |
| 220 | - $this->equalTo( '1-key' ), $this->equalTo( 'value' ), |
|
| 221 | - $this->equalTo( array( '1-siteid', '1-tag' ) ), $this->equalTo( null ) |
|
| 220 | + $this->equalTo('1-key'), $this->equalTo('value'), |
|
| 221 | + $this->equalTo(array('1-siteid', '1-tag')), $this->equalTo(null) |
|
| 222 | 222 | ); |
| 223 | 223 | |
| 224 | - $object->setList( array( 'key' => 'value' ), array( 'key' => array( 'tag' ) ), array() ); |
|
| 224 | + $object->setList(array('key' => 'value'), array('key' => array('tag')), array()); |
|
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | } |
@@ -26,43 +26,43 @@ 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' ) |
|
| 35 | + $mockHttpRequest = $this->getMockBuilder('TYPO3\Flow\Http\Request') |
|
| 36 | 36 | ->disableOriginalConstructor() |
| 37 | - ->setMethods( array( 'getBaseUri' ) ) |
|
| 37 | + ->setMethods(array('getBaseUri')) |
|
| 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->getMock( 'TYPO3\Flow\Mvc\ActionRequest', |
|
| 44 | - array( 'getControllerObjectName', 'getArgumentNamespace' ), array( $mockHttpRequest ) ); |
|
| 45 | - $mockMainRequest->expects( $this->any() ) |
|
| 46 | - ->method( 'getArgumentNamespace' ) |
|
| 47 | - ->will( $this->returnValue( 'ai' ) ); |
|
| 43 | + $mockMainRequest = $this->getMock('TYPO3\Flow\Mvc\ActionRequest', |
|
| 44 | + array('getControllerObjectName', 'getArgumentNamespace'), array($mockHttpRequest)); |
|
| 45 | + $mockMainRequest->expects($this->any()) |
|
| 46 | + ->method('getArgumentNamespace') |
|
| 47 | + ->will($this->returnValue('ai')); |
|
| 48 | 48 | |
| 49 | - $this->mockRouter = $this->getMockBuilder( 'TYPO3\Flow\Mvc\Routing\Router' )->getMock(); |
|
| 50 | - $mockEnv = $this->getMock( 'TYPO3\Flow\Utility\Environment', array( 'isRewriteEnabled' ), array(), '', false ); |
|
| 49 | + $this->mockRouter = $this->getMockBuilder('TYPO3\Flow\Mvc\Routing\Router')->getMock(); |
|
| 50 | + $mockEnv = $this->getMock('TYPO3\Flow\Utility\Environment', array('isRewriteEnabled'), array(), '', false); |
|
| 51 | 51 | |
| 52 | 52 | $builder = new \TYPO3\Flow\Mvc\Routing\UriBuilder(); |
| 53 | - $builder->setRequest( $mockMainRequest ); |
|
| 53 | + $builder->setRequest($mockMainRequest); |
|
| 54 | 54 | |
| 55 | - $objectReflection = new \ReflectionObject( $builder ); |
|
| 55 | + $objectReflection = new \ReflectionObject($builder); |
|
| 56 | 56 | |
| 57 | - $property = $objectReflection->getProperty( 'router' ); |
|
| 58 | - $property->setAccessible( true ); |
|
| 59 | - $property->setValue( $builder, $this->mockRouter ); |
|
| 57 | + $property = $objectReflection->getProperty('router'); |
|
| 58 | + $property->setAccessible(true); |
|
| 59 | + $property->setValue($builder, $this->mockRouter); |
|
| 60 | 60 | |
| 61 | - $property = $objectReflection->getProperty( 'environment' ); |
|
| 62 | - $property->setAccessible( true ); |
|
| 63 | - $property->setValue( $builder, $mockEnv ); |
|
| 61 | + $property = $objectReflection->getProperty('environment'); |
|
| 62 | + $property->setAccessible(true); |
|
| 63 | + $property->setValue($builder, $mockEnv); |
|
| 64 | 64 | |
| 65 | - $this->object = new \Aimeos\MW\View\Helper\Url\Flow( $view, $builder, array( 'site' => 'unittest' ) ); |
|
| 65 | + $this->object = new \Aimeos\MW\View\Helper\Url\Flow($view, $builder, array('site' => 'unittest')); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | |
@@ -80,60 +80,60 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | public function testTransform() |
| 82 | 82 | { |
| 83 | - $this->mockRouter->expects( $this->once() )->method( 'resolve' ) |
|
| 84 | - ->will( $this->returnValue( 'shop/catalog/lists') ); |
|
| 83 | + $this->mockRouter->expects($this->once())->method('resolve') |
|
| 84 | + ->will($this->returnValue('shop/catalog/lists')); |
|
| 85 | 85 | |
| 86 | - $this->assertEquals( '/index.php/shop/catalog/lists', $this->object->transform( 'shop', 'catalog', 'lists' ) ); |
|
| 86 | + $this->assertEquals('/index.php/shop/catalog/lists', $this->object->transform('shop', 'catalog', 'lists')); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | |
| 90 | 90 | public function testTransformSlashes() |
| 91 | 91 | { |
| 92 | - $this->mockRouter->expects( $this->once() )->method( 'resolve' ) |
|
| 93 | - ->will( $this->returnValue( 'shop/catalog/lists?test=a%2Fb') ); |
|
| 92 | + $this->mockRouter->expects($this->once())->method('resolve') |
|
| 93 | + ->will($this->returnValue('shop/catalog/lists?test=a%2Fb')); |
|
| 94 | 94 | |
| 95 | - $this->assertEquals( '/index.php/shop/catalog/lists?test=a%2Fb', $this->object->transform( 'shop', 'catalog', 'lists', array( 'test' => 'a/b' ) ) ); |
|
| 95 | + $this->assertEquals('/index.php/shop/catalog/lists?test=a%2Fb', $this->object->transform('shop', 'catalog', 'lists', array('test' => 'a/b'))); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | |
| 99 | 99 | public function testTransformArrays() |
| 100 | 100 | { |
| 101 | - $this->mockRouter->expects( $this->once() )->method( 'resolve' ) |
|
| 102 | - ->will( $this->returnValue( 'shop/catalog/list?test%5B0%5D=a&test%5B1%5D=b') ); |
|
| 101 | + $this->mockRouter->expects($this->once())->method('resolve') |
|
| 102 | + ->will($this->returnValue('shop/catalog/list?test%5B0%5D=a&test%5B1%5D=b')); |
|
| 103 | 103 | |
| 104 | - $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' ) ) ) ); |
|
| 104 | + $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')))); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | |
| 108 | 108 | public function testTransformTrailing() |
| 109 | 109 | { |
| 110 | - $this->mockRouter->expects( $this->once() )->method( 'resolve' ) |
|
| 111 | - ->will( $this->returnValue( 'shop/catalog/lists') ); |
|
| 110 | + $this->mockRouter->expects($this->once())->method('resolve') |
|
| 111 | + ->will($this->returnValue('shop/catalog/lists')); |
|
| 112 | 112 | |
| 113 | - $this->assertEquals( '/index.php/shop/catalog/lists#a/b', $this->object->transform( 'shop', 'catalog', 'lists', array(), array( 'a', 'b' ) ) ); |
|
| 113 | + $this->assertEquals('/index.php/shop/catalog/lists#a/b', $this->object->transform('shop', 'catalog', 'lists', array(), array('a', 'b'))); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | |
| 117 | 117 | public function testTransformAbsolute() |
| 118 | 118 | { |
| 119 | - $this->mockRouter->expects( $this->once() )->method( 'resolve' ) |
|
| 120 | - ->will( $this->returnValue( 'shop/catalog/lists') ); |
|
| 119 | + $this->mockRouter->expects($this->once())->method('resolve') |
|
| 120 | + ->will($this->returnValue('shop/catalog/lists')); |
|
| 121 | 121 | |
| 122 | - $options = array( 'absoluteUri' => true ); |
|
| 123 | - $result = $this->object->transform( 'shop', 'catalog', 'lists', array(), array(), $options ); |
|
| 122 | + $options = array('absoluteUri' => true); |
|
| 123 | + $result = $this->object->transform('shop', 'catalog', 'lists', array(), array(), $options); |
|
| 124 | 124 | |
| 125 | - $this->assertEquals( 'http://localhost/index.php/shop/catalog/lists', $result ); |
|
| 125 | + $this->assertEquals('http://localhost/index.php/shop/catalog/lists', $result); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | |
| 129 | 129 | public function testTransformConfig() |
| 130 | 130 | { |
| 131 | - $this->mockRouter->expects( $this->once() )->method( 'resolve' ) |
|
| 132 | - ->will( $this->returnValue( 'shop/catalog/lists') ); |
|
| 131 | + $this->mockRouter->expects($this->once())->method('resolve') |
|
| 132 | + ->will($this->returnValue('shop/catalog/lists')); |
|
| 133 | 133 | |
| 134 | - $options = array( 'package' => 'test', 'subpackage' => 'subtest', 'format' => 'fmt' ); |
|
| 135 | - $result = $this->object->transform( 'shop', 'catalog', 'lists', array(), array(), $options ); |
|
| 134 | + $options = array('package' => 'test', 'subpackage' => 'subtest', 'format' => 'fmt'); |
|
| 135 | + $result = $this->object->transform('shop', 'catalog', 'lists', array(), array(), $options); |
|
| 136 | 136 | |
| 137 | - $this->assertEquals( '/index.php/shop/catalog/lists', $result ); |
|
| 137 | + $this->assertEquals('/index.php/shop/catalog/lists', $result); |
|
| 138 | 138 | } |
| 139 | 139 | } |