@@ -28,8 +28,8 @@ discard block |
||
28 | 28 | { |
29 | 29 | $result = $this->getClient()->delete(); |
30 | 30 | |
31 | - $ids = (array) $this->getView()->param( 'id' ); |
|
32 | - \Aimeos\MShop\Factory::createManager( $this->getContext(), 'index' )->deleteItems( $ids ); |
|
31 | + $ids = (array) $this->getView()->param('id'); |
|
32 | + \Aimeos\MShop\Factory::createManager($this->getContext(), 'index')->deleteItems($ids); |
|
33 | 33 | |
34 | 34 | return $result; |
35 | 35 | } |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | $result = $this->getClient()->save(); |
46 | 46 | $item = $this->getView()->item; |
47 | 47 | |
48 | - if( $item->getId() !== null ) { |
|
49 | - \Aimeos\MShop\Factory::createManager( $this->getContext(), 'index' )->saveItem( $item ); |
|
48 | + if ($item->getId() !== null) { |
|
49 | + \Aimeos\MShop\Factory::createManager($this->getContext(), 'index')->saveItem($item); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | return $result; |
@@ -28,14 +28,14 @@ discard block |
||
28 | 28 | { |
29 | 29 | $result = $this->getClient()->delete(); |
30 | 30 | |
31 | - $ids = (array) $this->getView()->param( 'id' ); |
|
32 | - $tags = array( 'product' ); |
|
31 | + $ids = (array) $this->getView()->param('id'); |
|
32 | + $tags = array('product'); |
|
33 | 33 | |
34 | - foreach( $ids as $id ) { |
|
34 | + foreach ($ids as $id) { |
|
35 | 35 | $tags[] = 'product-' . $id; |
36 | 36 | } |
37 | 37 | |
38 | - $this->getContext()->getCache()->deleteByTags( $tags ); |
|
38 | + $this->getContext()->getCache()->deleteByTags($tags); |
|
39 | 39 | |
40 | 40 | return $result; |
41 | 41 | } |
@@ -51,10 +51,10 @@ discard block |
||
51 | 51 | $result = $this->getClient()->save(); |
52 | 52 | $item = $this->getView()->item; |
53 | 53 | |
54 | - if( $item->getId() !== null ) |
|
54 | + if ($item->getId() !== null) |
|
55 | 55 | { |
56 | 56 | $idtag = 'product-' . $item->getId(); |
57 | - $this->getContext()->getCache()->deleteByTags( array( 'product', $idtag ) ); |
|
57 | + $this->getContext()->getCache()->deleteByTags(array('product', $idtag)); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | return $result; |
@@ -19,61 +19,61 @@ |
||
19 | 19 | |
20 | 20 | protected function setUp() |
21 | 21 | { |
22 | - $this->cache = $this->getMockBuilder( 'Aimeos\MW\Cache\None' ) |
|
23 | - ->setMethods( array( 'deleteByTags' ) ) |
|
22 | + $this->cache = $this->getMockBuilder('Aimeos\MW\Cache\None') |
|
23 | + ->setMethods(array('deleteByTags')) |
|
24 | 24 | ->disableOriginalConstructor() |
25 | 25 | ->getMock(); |
26 | 26 | |
27 | - $this->mock = $this->getMockBuilder( 'Aimeos\Admin\JQAdm\Product\Standard' ) |
|
28 | - ->setMethods( array( 'delete', 'save' ) ) |
|
27 | + $this->mock = $this->getMockBuilder('Aimeos\Admin\JQAdm\Product\Standard') |
|
28 | + ->setMethods(array('delete', 'save')) |
|
29 | 29 | ->disableOriginalConstructor() |
30 | 30 | ->getMock(); |
31 | 31 | |
32 | 32 | $templatePaths = \TestHelperJqadm::getTemplatePaths(); |
33 | 33 | $this->context = \TestHelperJqadm::getContext(); |
34 | - $this->context->setCache( $this->cache ); |
|
34 | + $this->context->setCache($this->cache); |
|
35 | 35 | |
36 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Cache( $this->mock, $this->context, $templatePaths ); |
|
36 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Cache($this->mock, $this->context, $templatePaths); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | |
40 | 40 | protected function tearDown() |
41 | 41 | { |
42 | - unset( $this->object, $this->mock, $this->context, $this->cache ); |
|
42 | + unset($this->object, $this->mock, $this->context, $this->cache); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | |
46 | 46 | public function testDelete() |
47 | 47 | { |
48 | 48 | $view = \TestHelperJqadm::getView(); |
49 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'id' => 1 ) ); |
|
50 | - $view->addHelper( 'param', $helper ); |
|
49 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, array('id' => 1)); |
|
50 | + $view->addHelper('param', $helper); |
|
51 | 51 | |
52 | - $tags = array( 'product', 'product-1' ); |
|
53 | - $this->cache->expects( $this->once() )->method( 'deleteByTags' )->with( $this->equalTo( $tags ) ); |
|
54 | - $this->mock->expects( $this->once() )->method( 'delete' )->will( $this->returnValue( 'test' ) ); |
|
52 | + $tags = array('product', 'product-1'); |
|
53 | + $this->cache->expects($this->once())->method('deleteByTags')->with($this->equalTo($tags)); |
|
54 | + $this->mock->expects($this->once())->method('delete')->will($this->returnValue('test')); |
|
55 | 55 | |
56 | - $this->object->setView( $view ); |
|
56 | + $this->object->setView($view); |
|
57 | 57 | $result = $this->object->delete(); |
58 | 58 | |
59 | - $this->assertEquals( 'test', $result ); |
|
59 | + $this->assertEquals('test', $result); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | |
63 | 63 | public function testSave() |
64 | 64 | { |
65 | - $item = \Aimeos\MShop\Factory::createManager( $this->context, 'product' )->findItem( 'CNC' ); |
|
65 | + $item = \Aimeos\MShop\Factory::createManager($this->context, 'product')->findItem('CNC'); |
|
66 | 66 | |
67 | - $tags = array( 'product', 'product-' . $item->getId() ); |
|
67 | + $tags = array('product', 'product-' . $item->getId()); |
|
68 | 68 | $view = \TestHelperJqadm::getView(); |
69 | 69 | $view->item = $item; |
70 | 70 | |
71 | - $this->cache->expects( $this->once() )->method( 'deleteByTags' )->with( $this->equalTo( $tags ) ); |
|
72 | - $this->mock->expects( $this->once() )->method( 'save' )->will( $this->returnValue( 'test' ) ); |
|
71 | + $this->cache->expects($this->once())->method('deleteByTags')->with($this->equalTo($tags)); |
|
72 | + $this->mock->expects($this->once())->method('save')->will($this->returnValue('test')); |
|
73 | 73 | |
74 | - $this->object->setView( $view ); |
|
74 | + $this->object->setView($view); |
|
75 | 75 | $result = $this->object->save(); |
76 | 76 | |
77 | - $this->assertEquals( 'test', $result ); |
|
77 | + $this->assertEquals('test', $result); |
|
78 | 78 | } |
79 | 79 | } |
@@ -21,46 +21,46 @@ |
||
21 | 21 | $this->context = \TestHelperJqadm::getContext(); |
22 | 22 | $templatePaths = \TestHelperJqadm::getTemplatePaths(); |
23 | 23 | |
24 | - $this->mock = $this->getMockBuilder( 'Aimeos\Admin\JQAdm\Product\Standard' ) |
|
25 | - ->setMethods( array( 'delete', 'save' ) ) |
|
24 | + $this->mock = $this->getMockBuilder('Aimeos\Admin\JQAdm\Product\Standard') |
|
25 | + ->setMethods(array('delete', 'save')) |
|
26 | 26 | ->disableOriginalConstructor() |
27 | 27 | ->getMock(); |
28 | 28 | |
29 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Index( $this->mock, $this->context, $templatePaths ); |
|
29 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Index($this->mock, $this->context, $templatePaths); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | |
33 | 33 | protected function tearDown() |
34 | 34 | { |
35 | - unset( $this->object, $this->mock, $this->context ); |
|
35 | + unset($this->object, $this->mock, $this->context); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
39 | 39 | public function testDelete() |
40 | 40 | { |
41 | 41 | $view = \TestHelperJqadm::getView(); |
42 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'id' => 1 ) ); |
|
43 | - $view->addHelper( 'param', $helper ); |
|
42 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, array('id' => 1)); |
|
43 | + $view->addHelper('param', $helper); |
|
44 | 44 | |
45 | - $this->mock->expects( $this->once() )->method( 'delete' )->will( $this->returnValue( 'test' ) ); |
|
46 | - $this->object->setView( $view ); |
|
45 | + $this->mock->expects($this->once())->method('delete')->will($this->returnValue('test')); |
|
46 | + $this->object->setView($view); |
|
47 | 47 | |
48 | 48 | $result = $this->object->delete(); |
49 | 49 | |
50 | - $this->assertEquals( 'test', $result ); |
|
50 | + $this->assertEquals('test', $result); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | |
54 | 54 | public function testSave() |
55 | 55 | { |
56 | 56 | $view = \TestHelperJqadm::getView(); |
57 | - $view->item = \Aimeos\MShop\Factory::createManager( $this->context, 'product' )->findItem( 'CNC' ); |
|
57 | + $view->item = \Aimeos\MShop\Factory::createManager($this->context, 'product')->findItem('CNC'); |
|
58 | 58 | |
59 | - $this->mock->expects( $this->once() )->method( 'save' )->will( $this->returnValue( 'test' ) ); |
|
60 | - $this->object->setView( $view ); |
|
59 | + $this->mock->expects($this->once())->method('save')->will($this->returnValue('test')); |
|
60 | + $this->object->setView($view); |
|
61 | 61 | |
62 | 62 | $result = $this->object->save(); |
63 | 63 | |
64 | - $this->assertEquals( 'test', $result ); |
|
64 | + $this->assertEquals('test', $result); |
|
65 | 65 | } |
66 | 66 | } |