@@ -20,14 +20,14 @@ discard block |
||
20 | 20 | $this->context = \TestHelperJqadm::getContext(); |
21 | 21 | $templatePaths = \TestHelperJqadm::getTemplatePaths(); |
22 | 22 | |
23 | - $client = new \Aimeos\Admin\JQAdm\Product\Standard( $this->context, $templatePaths ); |
|
24 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Languages( $client, $this->context, $templatePaths ); |
|
23 | + $client = new \Aimeos\Admin\JQAdm\Product\Standard($this->context, $templatePaths); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Languages($client, $this->context, $templatePaths); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | |
28 | 28 | protected function tearDown() |
29 | 29 | { |
30 | - unset( $this->object, $this->context ); |
|
30 | + unset($this->object, $this->context); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | { |
36 | 36 | $view = \TestHelperJqadm::getView(); |
37 | 37 | |
38 | - $this->object->setView( $view ); |
|
38 | + $this->object->setView($view); |
|
39 | 39 | |
40 | - $this->assertInternalType( 'array', $view->languagesList ); |
|
40 | + $this->assertInternalType('array', $view->languagesList); |
|
41 | 41 | } |
42 | 42 | } |
@@ -17,83 +17,83 @@ |
||
17 | 17 | |
18 | 18 | protected function setUp() |
19 | 19 | { |
20 | - $this->mock = $this->getMockBuilder( 'Aimeos\Admin\JQAdm\Product\Standard' ) |
|
21 | - ->setMethods( array( 'copy', 'create', 'delete', 'get', 'save', 'search', 'getSubClient' ) ) |
|
20 | + $this->mock = $this->getMockBuilder('Aimeos\Admin\JQAdm\Product\Standard') |
|
21 | + ->setMethods(array('copy', 'create', 'delete', 'get', 'save', 'search', 'getSubClient')) |
|
22 | 22 | ->disableOriginalConstructor() |
23 | 23 | ->getMock(); |
24 | 24 | |
25 | 25 | $templatePaths = \TestHelperJqadm::getTemplatePaths(); |
26 | 26 | $context = \TestHelperJqadm::getContext(); |
27 | 27 | |
28 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Sites( $this->mock, $context, $templatePaths ); |
|
28 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Sites($this->mock, $context, $templatePaths); |
|
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 testCallInvalid() |
39 | 39 | { |
40 | - $this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' ); |
|
40 | + $this->setExpectedException('\Aimeos\Admin\JQAdm\Exception'); |
|
41 | 41 | $this->object->invalidMethod(); |
42 | 42 | } |
43 | 43 | |
44 | 44 | |
45 | 45 | public function testCopy() |
46 | 46 | { |
47 | - $this->mock->expects( $this->once() )->method( 'copy' )->will( $this->returnValue( 'test' ) ); |
|
47 | + $this->mock->expects($this->once())->method('copy')->will($this->returnValue('test')); |
|
48 | 48 | |
49 | - $this->assertEquals( 'test', $this->object->copy() ); |
|
49 | + $this->assertEquals('test', $this->object->copy()); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | |
53 | 53 | public function testCreate() |
54 | 54 | { |
55 | - $this->mock->expects( $this->once() )->method( 'create' )->will( $this->returnValue( 'test' ) ); |
|
55 | + $this->mock->expects($this->once())->method('create')->will($this->returnValue('test')); |
|
56 | 56 | |
57 | - $this->assertEquals( 'test', $this->object->create() ); |
|
57 | + $this->assertEquals('test', $this->object->create()); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | |
61 | 61 | public function testDelete() |
62 | 62 | { |
63 | - $this->mock->expects( $this->once() )->method( 'delete' )->will( $this->returnValue( 'test' ) ); |
|
63 | + $this->mock->expects($this->once())->method('delete')->will($this->returnValue('test')); |
|
64 | 64 | |
65 | - $this->assertEquals( 'test', $this->object->delete() ); |
|
65 | + $this->assertEquals('test', $this->object->delete()); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | |
69 | 69 | public function testGet() |
70 | 70 | { |
71 | - $this->mock->expects( $this->once() )->method( 'get' )->will( $this->returnValue( 'test' ) ); |
|
71 | + $this->mock->expects($this->once())->method('get')->will($this->returnValue('test')); |
|
72 | 72 | |
73 | - $this->assertEquals( 'test', $this->object->get() ); |
|
73 | + $this->assertEquals('test', $this->object->get()); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | |
77 | 77 | public function testSave() |
78 | 78 | { |
79 | - $this->mock->expects( $this->once() )->method( 'save' )->will( $this->returnValue( 'test' ) ); |
|
79 | + $this->mock->expects($this->once())->method('save')->will($this->returnValue('test')); |
|
80 | 80 | |
81 | - $this->assertEquals( 'test', $this->object->save() ); |
|
81 | + $this->assertEquals('test', $this->object->save()); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | |
85 | 85 | public function testSearch() |
86 | 86 | { |
87 | - $this->mock->expects( $this->once() )->method( 'search' )->will( $this->returnValue( 'test' ) ); |
|
87 | + $this->mock->expects($this->once())->method('search')->will($this->returnValue('test')); |
|
88 | 88 | |
89 | - $this->assertEquals( 'test', $this->object->search() ); |
|
89 | + $this->assertEquals('test', $this->object->search()); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | |
93 | 93 | public function testGetSubClient() |
94 | 94 | { |
95 | - $this->mock->expects( $this->once() )->method( 'getSubClient' )->will( $this->returnValue( 'test' ) ); |
|
95 | + $this->mock->expects($this->once())->method('getSubClient')->will($this->returnValue('test')); |
|
96 | 96 | |
97 | - $this->assertEquals( 'test', $this->object->getSubClient( 'invalid' ) ); |
|
97 | + $this->assertEquals('test', $this->object->getSubClient('invalid')); |
|
98 | 98 | } |
99 | 99 | } |
@@ -20,14 +20,14 @@ discard block |
||
20 | 20 | $this->context = \TestHelperJqadm::getContext(); |
21 | 21 | $templatePaths = \TestHelperJqadm::getTemplatePaths(); |
22 | 22 | |
23 | - $client = new \Aimeos\Admin\JQAdm\Product\Standard( $this->context, $templatePaths ); |
|
24 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Sites( $client, $this->context, $templatePaths ); |
|
23 | + $client = new \Aimeos\Admin\JQAdm\Product\Standard($this->context, $templatePaths); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Sites($client, $this->context, $templatePaths); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | |
28 | 28 | protected function tearDown() |
29 | 29 | { |
30 | - unset( $this->object, $this->context ); |
|
30 | + unset($this->object, $this->context); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | { |
36 | 36 | $view = \TestHelperJqadm::getView(); |
37 | 37 | |
38 | - $this->object->setView( $view ); |
|
38 | + $this->object->setView($view); |
|
39 | 39 | |
40 | - $this->assertInternalType( 'array', $view->sitesList ); |
|
40 | + $this->assertInternalType('array', $view->sitesList); |
|
41 | 41 | } |
42 | 42 | } |
@@ -4,17 +4,17 @@ |
||
4 | 4 | 'jqadm' => array( |
5 | 5 | 'common' => array( |
6 | 6 | 'decorators' => array( |
7 | - 'default' => array( 'Languages', 'Sites' ), |
|
7 | + 'default' => array('Languages', 'Sites'), |
|
8 | 8 | ), |
9 | 9 | ), |
10 | 10 | 'product' => array( |
11 | 11 | 'decorators' => array( |
12 | - 'global' => array( 'Index', 'Cache' ), |
|
12 | + 'global' => array('Index', 'Cache'), |
|
13 | 13 | ), |
14 | 14 | ), |
15 | 15 | 'product/category' => array( |
16 | 16 | 'decorators' => array( |
17 | - 'local' => array( 'Cache' ), |
|
17 | + 'local' => array('Cache'), |
|
18 | 18 | ), |
19 | 19 | ), |
20 | 20 | ), |
@@ -25,14 +25,14 @@ |
||
25 | 25 | * @param \Aimeos\MW\View\Iface $view The view object which generates the admin output |
26 | 26 | * @return \Aimeos\Admin\JQAdm\Iface Reference to this object for fluent calls |
27 | 27 | */ |
28 | - public function setView( \Aimeos\MW\View\Iface $view ) |
|
28 | + public function setView(\Aimeos\MW\View\Iface $view) |
|
29 | 29 | { |
30 | - $extdir = dirname( dirname( dirname( dirname( dirname( dirname( dirname( dirname( __DIR__ ) ) ) ) ) ) ) ); |
|
31 | - $aimeos = new \Aimeos\Bootstrap( array( $extdir ) ); |
|
30 | + $extdir = dirname(dirname(dirname(dirname(dirname(dirname(dirname(dirname(__DIR__)))))))); |
|
31 | + $aimeos = new \Aimeos\Bootstrap(array($extdir)); |
|
32 | 32 | |
33 | - $view->languagesList = $aimeos->getI18nList( 'admin' ); |
|
33 | + $view->languagesList = $aimeos->getI18nList('admin'); |
|
34 | 34 | |
35 | - $this->getClient()->setView( $view ); |
|
35 | + $this->getClient()->setView($view); |
|
36 | 36 | return $this; |
37 | 37 | } |
38 | 38 | } |
@@ -25,21 +25,21 @@ |
||
25 | 25 | * @param \Aimeos\MW\View\Iface $view The view object which generates the admin output |
26 | 26 | * @return \Aimeos\Admin\JQAdm\Iface Reference to this object for fluent calls |
27 | 27 | */ |
28 | - public function setView( \Aimeos\MW\View\Iface $view ) |
|
28 | + public function setView(\Aimeos\MW\View\Iface $view) |
|
29 | 29 | { |
30 | 30 | $list = array(); |
31 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'locale/site' ); |
|
31 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'locale/site'); |
|
32 | 32 | |
33 | 33 | $search = $manager->createSearch(); |
34 | - $search->setSortations( array( $search->sort( '+', 'locale.site.label' ) ) ); |
|
34 | + $search->setSortations(array($search->sort('+', 'locale.site.label'))); |
|
35 | 35 | |
36 | - foreach( $manager->searchItems( $search ) as $item ) { |
|
36 | + foreach ($manager->searchItems($search) as $item) { |
|
37 | 37 | $list[$item->getCode()] = $item->getLabel(); |
38 | 38 | } |
39 | 39 | |
40 | 40 | $view->sitesList = $list; |
41 | 41 | |
42 | - $this->getClient()->setView( $view ); |
|
42 | + $this->getClient()->setView($view); |
|
43 | 43 | return $this; |
44 | 44 | } |
45 | 45 | } |
@@ -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 | } |