@@ -22,38 +22,38 @@ discard block |
||
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | $templatePaths = \TestHelperJqadm::getTemplatePaths(); |
24 | 24 | |
25 | - $this->object = new \Aimeos\Admin\JQAdm\Product\Text\Standard( $this->context, $templatePaths ); |
|
26 | - $this->object->setView( $this->view ); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Product\Text\Standard($this->context, $templatePaths); |
|
26 | + $this->object->setView($this->view); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | |
30 | 30 | protected function tearDown() |
31 | 31 | { |
32 | - unset( $this->object ); |
|
32 | + unset($this->object); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
36 | 36 | public function testCreate() |
37 | 37 | { |
38 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' ); |
|
38 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'product'); |
|
39 | 39 | |
40 | 40 | $this->view->item = $manager->createItem(); |
41 | 41 | $result = $this->object->create(); |
42 | 42 | |
43 | - $this->assertContains( 'Texts', $result ); |
|
44 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
43 | + $this->assertContains('Texts', $result); |
|
44 | + $this->assertNull($this->view->get('errors')); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
48 | 48 | public function testCopy() |
49 | 49 | { |
50 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' ); |
|
50 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'product'); |
|
51 | 51 | |
52 | - $this->view->item = $manager->findItem( 'ABCD', array( 'text' ) ); |
|
52 | + $this->view->item = $manager->findItem('ABCD', array('text')); |
|
53 | 53 | $result = $this->object->copy(); |
54 | 54 | |
55 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
56 | - $this->assertContains( 'value="Unterproduct 1"', $result ); |
|
55 | + $this->assertNull($this->view->get('errors')); |
|
56 | + $this->assertContains('value="Unterproduct 1"', $result); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | |
@@ -61,73 +61,73 @@ discard block |
||
61 | 61 | { |
62 | 62 | $result = $this->object->delete(); |
63 | 63 | |
64 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
65 | - $this->assertNull( $result ); |
|
64 | + $this->assertNull($this->view->get('errors')); |
|
65 | + $this->assertNull($result); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | |
69 | 69 | public function testGet() |
70 | 70 | { |
71 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' ); |
|
71 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'product'); |
|
72 | 72 | |
73 | - $this->view->item = $manager->findItem( 'ABCD', array( 'text' ) ); |
|
73 | + $this->view->item = $manager->findItem('ABCD', array('text')); |
|
74 | 74 | $result = $this->object->get(); |
75 | 75 | |
76 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
77 | - $this->assertContains( 'value="Unterproduct 1"', $result ); |
|
76 | + $this->assertNull($this->view->get('errors')); |
|
77 | + $this->assertContains('value="Unterproduct 1"', $result); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | |
81 | 81 | public function testSave() |
82 | 82 | { |
83 | - $typeManager = \Aimeos\MShop\Factory::createManager( $this->context, 'text/type' ); |
|
84 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' ); |
|
83 | + $typeManager = \Aimeos\MShop\Factory::createManager($this->context, 'text/type'); |
|
84 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'product'); |
|
85 | 85 | |
86 | - $item = $manager->findItem( 'CNC' ); |
|
87 | - $item->setCode( 'jqadm-test-save' ); |
|
88 | - $item->setId( null ); |
|
86 | + $item = $manager->findItem('CNC'); |
|
87 | + $item->setCode('jqadm-test-save'); |
|
88 | + $item->setId(null); |
|
89 | 89 | |
90 | - $manager->saveItem( $item ); |
|
90 | + $manager->saveItem($item); |
|
91 | 91 | |
92 | 92 | |
93 | 93 | $param = array( |
94 | 94 | 'text' => array( |
95 | - 'langid' => array( 'de' ), |
|
96 | - 'name' => array( 'listid' => '', 'content' => 'test name' ), |
|
97 | - 'short' => array( 'listid' => '', 'content' => 'short desc' ), |
|
98 | - 'long' => array( 'listid' => '', 'content' => 'long desc' ), |
|
99 | - 'url' => array( 'listid' => '', 'content' => 'url segment' ), |
|
100 | - 'meta-keyword' => array( 'listid' => '', 'content' => 'meta keywords' ), |
|
101 | - 'meta-description' => array( 'listid' => '', 'content' => 'meta desc' ), |
|
95 | + 'langid' => array('de'), |
|
96 | + 'name' => array('listid' => '', 'content' => 'test name'), |
|
97 | + 'short' => array('listid' => '', 'content' => 'short desc'), |
|
98 | + 'long' => array('listid' => '', 'content' => 'long desc'), |
|
99 | + 'url' => array('listid' => '', 'content' => 'url segment'), |
|
100 | + 'meta-keyword' => array('listid' => '', 'content' => 'meta keywords'), |
|
101 | + 'meta-description' => array('listid' => '', 'content' => 'meta desc'), |
|
102 | 102 | ), |
103 | 103 | ); |
104 | 104 | |
105 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
106 | - $this->view->addHelper( 'param', $helper ); |
|
105 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
106 | + $this->view->addHelper('param', $helper); |
|
107 | 107 | $this->view->item = $item; |
108 | 108 | |
109 | 109 | $result = $this->object->save(); |
110 | 110 | |
111 | - $item = $manager->getItem( $item->getId(), array( 'text' ) ); |
|
112 | - $manager->deleteItem( $item->getId() ); |
|
111 | + $item = $manager->getItem($item->getId(), array('text')); |
|
112 | + $manager->deleteItem($item->getId()); |
|
113 | 113 | |
114 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
115 | - $this->assertNull( $result ); |
|
116 | - $this->assertEquals( 6, count( $item->getListItems() ) ); |
|
114 | + $this->assertNull($this->view->get('errors')); |
|
115 | + $this->assertNull($result); |
|
116 | + $this->assertEquals(6, count($item->getListItems())); |
|
117 | 117 | |
118 | - foreach( $item->getListItems( 'text' ) as $listItem ) |
|
118 | + foreach ($item->getListItems('text') as $listItem) |
|
119 | 119 | { |
120 | - $this->assertEquals( 'text', $listItem->getDomain() ); |
|
121 | - $this->assertEquals( 'default', $listItem->getType() ); |
|
120 | + $this->assertEquals('text', $listItem->getDomain()); |
|
121 | + $this->assertEquals('default', $listItem->getType()); |
|
122 | 122 | |
123 | 123 | $refItem = $listItem->getRefItem(); |
124 | - $this->assertEquals( 'de', $refItem->getLanguageId() ); |
|
124 | + $this->assertEquals('de', $refItem->getLanguageId()); |
|
125 | 125 | } |
126 | 126 | } |
127 | 127 | |
128 | 128 | |
129 | 129 | public function testSearch() |
130 | 130 | { |
131 | - $this->assertNull( $this->object->search() ); |
|
131 | + $this->assertNull($this->object->search()); |
|
132 | 132 | } |
133 | 133 | } |
@@ -22,44 +22,44 @@ discard block |
||
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | $templatePaths = \TestHelperJqadm::getTemplatePaths(); |
24 | 24 | |
25 | - $this->object = new \Aimeos\Admin\JQAdm\Product\Selection\Standard( $this->context, $templatePaths ); |
|
26 | - $this->object->setView( $this->view ); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Product\Selection\Standard($this->context, $templatePaths); |
|
26 | + $this->object->setView($this->view); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | |
30 | 30 | protected function tearDown() |
31 | 31 | { |
32 | - unset( $this->object ); |
|
32 | + unset($this->object); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
36 | 36 | public function testCreate() |
37 | 37 | { |
38 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' ); |
|
38 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'product'); |
|
39 | 39 | |
40 | 40 | $this->view->item = $manager->createItem(); |
41 | 41 | $result = $this->object->create(); |
42 | 42 | |
43 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
44 | - $this->assertStringStartsWith( '<div class="product-item-selection', $result ); |
|
43 | + $this->assertNull($this->view->get('errors')); |
|
44 | + $this->assertStringStartsWith('<div class="product-item-selection', $result); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
48 | 48 | public function testCopy() |
49 | 49 | { |
50 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' ); |
|
50 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'product'); |
|
51 | 51 | |
52 | - $this->view->item = $manager->findItem( 'U:TEST', array( 'product' ) ); |
|
52 | + $this->view->item = $manager->findItem('U:TEST', array('product')); |
|
53 | 53 | $result = $this->object->copy(); |
54 | 54 | |
55 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
56 | - $this->assertContains( 'U:TESTSUB01', $result ); |
|
57 | - $this->assertContains( 'U:TESTSUB02', $result ); |
|
58 | - $this->assertContains( 'U:TESTSUB03', $result ); |
|
59 | - $this->assertContains( 'U:TESTSUB04', $result ); |
|
60 | - $this->assertContains( 'U:TESTSUB05', $result ); |
|
61 | - $this->assertContains( 'value="30"', $result ); |
|
62 | - $this->assertContains( 'value="32"', $result ); |
|
55 | + $this->assertNull($this->view->get('errors')); |
|
56 | + $this->assertContains('U:TESTSUB01', $result); |
|
57 | + $this->assertContains('U:TESTSUB02', $result); |
|
58 | + $this->assertContains('U:TESTSUB03', $result); |
|
59 | + $this->assertContains('U:TESTSUB04', $result); |
|
60 | + $this->assertContains('U:TESTSUB05', $result); |
|
61 | + $this->assertContains('value="30"', $result); |
|
62 | + $this->assertContains('value="32"', $result); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | |
@@ -67,83 +67,83 @@ discard block |
||
67 | 67 | { |
68 | 68 | $param = array( |
69 | 69 | 'selection' => array( |
70 | - 'product.id' => array( 0 => '' ), |
|
71 | - 'product.code' => array( 0 => 'testprod' ), |
|
72 | - 'product.label' => array( 0 => 'test product' ), |
|
70 | + 'product.id' => array(0 => ''), |
|
71 | + 'product.code' => array(0 => 'testprod'), |
|
72 | + 'product.label' => array(0 => 'test product'), |
|
73 | 73 | 'attr' => array( |
74 | - 'id' => array( 0 => '123' ), |
|
75 | - 'label' => array( 0 => 'test attribute' ), |
|
76 | - 'ref' => array( 0 => 'testprod' ), |
|
74 | + 'id' => array(0 => '123'), |
|
75 | + 'label' => array(0 => 'test attribute'), |
|
76 | + 'ref' => array(0 => 'testprod'), |
|
77 | 77 | ) |
78 | 78 | ), |
79 | 79 | ); |
80 | 80 | |
81 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
82 | - $this->view->addHelper( 'param', $helper ); |
|
81 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
82 | + $this->view->addHelper('param', $helper); |
|
83 | 83 | |
84 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' ); |
|
85 | - $this->view->item = $manager->findItem( 'U:TEST' ); |
|
84 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'product'); |
|
85 | + $this->view->item = $manager->findItem('U:TEST'); |
|
86 | 86 | |
87 | 87 | $result = $this->object->get(); |
88 | 88 | |
89 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
90 | - $this->assertContains( 'testprod', $result ); |
|
91 | - $this->assertContains( 'value="123"', $result ); |
|
89 | + $this->assertNull($this->view->get('errors')); |
|
90 | + $this->assertContains('testprod', $result); |
|
91 | + $this->assertContains('value="123"', $result); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | |
95 | 95 | public function testSave() |
96 | 96 | { |
97 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' ); |
|
97 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'product'); |
|
98 | 98 | |
99 | - $item = $manager->findItem( 'U:TEST' ); |
|
100 | - $item->setCode( 'jqadm-test-selection' ); |
|
101 | - $item->setId( null ); |
|
99 | + $item = $manager->findItem('U:TEST'); |
|
100 | + $item->setCode('jqadm-test-selection'); |
|
101 | + $item->setId(null); |
|
102 | 102 | |
103 | - $manager->saveItem( $item ); |
|
103 | + $manager->saveItem($item); |
|
104 | 104 | |
105 | - $attrManager = \Aimeos\MShop\Factory::createManager( $this->context, 'attribute' ); |
|
106 | - $attrItem = $attrManager->findItem( 'xs', array(), 'product', 'size' ); |
|
105 | + $attrManager = \Aimeos\MShop\Factory::createManager($this->context, 'attribute'); |
|
106 | + $attrItem = $attrManager->findItem('xs', array(), 'product', 'size'); |
|
107 | 107 | |
108 | 108 | |
109 | 109 | $param = array( |
110 | 110 | 'selection' => array( |
111 | - 'product.lists.id' => array( 0 => '' ), |
|
112 | - 'product.id' => array( 0 => $item->getId() ), |
|
113 | - 'product.code' => array( 0 => 'testprod' ), |
|
114 | - 'product.label' => array( 0 => 'test product' ), |
|
111 | + 'product.lists.id' => array(0 => ''), |
|
112 | + 'product.id' => array(0 => $item->getId()), |
|
113 | + 'product.code' => array(0 => 'testprod'), |
|
114 | + 'product.label' => array(0 => 'test product'), |
|
115 | 115 | 'attr' => array( |
116 | - 'id' => array( 0 => $attrItem->getId() ), |
|
117 | - 'label' => array( 0 => 'test attribute' ), |
|
118 | - 'ref' => array( 0 => 'testprod' ), |
|
116 | + 'id' => array(0 => $attrItem->getId()), |
|
117 | + 'label' => array(0 => 'test attribute'), |
|
118 | + 'ref' => array(0 => 'testprod'), |
|
119 | 119 | ) |
120 | 120 | ), |
121 | 121 | ); |
122 | 122 | |
123 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
124 | - $this->view->addHelper( 'param', $helper ); |
|
123 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
124 | + $this->view->addHelper('param', $helper); |
|
125 | 125 | $this->view->item = $item; |
126 | 126 | |
127 | 127 | $result = $this->object->save(); |
128 | 128 | |
129 | - $item = $manager->getItem( $item->getId(), array( 'product' ) ); |
|
130 | - $variants = $item->getListItems( 'product', 'default' ); |
|
129 | + $item = $manager->getItem($item->getId(), array('product')); |
|
130 | + $variants = $item->getListItems('product', 'default'); |
|
131 | 131 | |
132 | - if( empty( $variants ) ) { |
|
133 | - throw new \Exception( 'No variant products available' ); |
|
132 | + if (empty($variants)) { |
|
133 | + throw new \Exception('No variant products available'); |
|
134 | 134 | } |
135 | 135 | |
136 | - $variant = $manager->getItem( reset( $variants )->getRefId(), array( 'attribute' ) ); |
|
137 | - $attributes = $variant->getListItems( 'attribute', 'variant' ); |
|
136 | + $variant = $manager->getItem(reset($variants)->getRefId(), array('attribute')); |
|
137 | + $attributes = $variant->getListItems('attribute', 'variant'); |
|
138 | 138 | |
139 | - $manager->deleteItems( array( $item->getId(), $variant->getId() ) ); |
|
139 | + $manager->deleteItems(array($item->getId(), $variant->getId())); |
|
140 | 140 | |
141 | 141 | |
142 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
143 | - $this->assertNull( $result ); |
|
144 | - $this->assertEquals( 1, count( $variants ) ); |
|
145 | - $this->assertEquals( 1, count( $attributes ) ); |
|
146 | - $this->assertEquals( 'testprod', $variant->getCode() ); |
|
147 | - $this->assertEquals( $attrItem->getId(), reset( $attributes )->getRefId() ); |
|
142 | + $this->assertNull($this->view->get('errors')); |
|
143 | + $this->assertNull($result); |
|
144 | + $this->assertEquals(1, count($variants)); |
|
145 | + $this->assertEquals(1, count($attributes)); |
|
146 | + $this->assertEquals('testprod', $variant->getCode()); |
|
147 | + $this->assertEquals($attrItem->getId(), reset($attributes)->getRefId()); |
|
148 | 148 | } |
149 | 149 | } |
@@ -22,68 +22,68 @@ discard block |
||
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | $templatePaths = \TestHelperJqadm::getTemplatePaths(); |
24 | 24 | |
25 | - $this->object = new \Aimeos\Admin\JQAdm\Product\Physical\Standard( $this->context, $templatePaths ); |
|
26 | - $this->object->setView( $this->view ); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Product\Physical\Standard($this->context, $templatePaths); |
|
26 | + $this->object->setView($this->view); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | |
30 | 30 | protected function tearDown() |
31 | 31 | { |
32 | - unset( $this->object ); |
|
32 | + unset($this->object); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
36 | 36 | public function testCreate() |
37 | 37 | { |
38 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' ); |
|
38 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'product'); |
|
39 | 39 | |
40 | 40 | $this->view->item = $manager->createItem(); |
41 | 41 | $result = $this->object->create(); |
42 | 42 | |
43 | - $this->assertContains( 'Physical', $result ); |
|
44 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
43 | + $this->assertContains('Physical', $result); |
|
44 | + $this->assertNull($this->view->get('errors')); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
48 | 48 | public function testCopy() |
49 | 49 | { |
50 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' ); |
|
50 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'product'); |
|
51 | 51 | |
52 | - $this->view->item = $manager->findItem( 'CNC' ); |
|
52 | + $this->view->item = $manager->findItem('CNC'); |
|
53 | 53 | $result = $this->object->copy(); |
54 | 54 | |
55 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
56 | - $this->assertContains( 'value="20.0"', $result ); |
|
57 | - $this->assertContains( 'value="15.0"', $result ); |
|
58 | - $this->assertContains( 'value="10.0"', $result ); |
|
59 | - $this->assertContains( 'value="1.25"', $result ); |
|
55 | + $this->assertNull($this->view->get('errors')); |
|
56 | + $this->assertContains('value="20.0"', $result); |
|
57 | + $this->assertContains('value="15.0"', $result); |
|
58 | + $this->assertContains('value="10.0"', $result); |
|
59 | + $this->assertContains('value="1.25"', $result); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | |
63 | 63 | public function testGet() |
64 | 64 | { |
65 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' ); |
|
65 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'product'); |
|
66 | 66 | |
67 | - $this->view->item = $manager->findItem( 'CNC' ); |
|
67 | + $this->view->item = $manager->findItem('CNC'); |
|
68 | 68 | $result = $this->object->get(); |
69 | 69 | |
70 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
71 | - $this->assertContains( 'value="20.0"', $result ); |
|
72 | - $this->assertContains( 'value="15.0"', $result ); |
|
73 | - $this->assertContains( 'value="10.0"', $result ); |
|
74 | - $this->assertContains( 'value="1.25"', $result ); |
|
70 | + $this->assertNull($this->view->get('errors')); |
|
71 | + $this->assertContains('value="20.0"', $result); |
|
72 | + $this->assertContains('value="15.0"', $result); |
|
73 | + $this->assertContains('value="10.0"', $result); |
|
74 | + $this->assertContains('value="1.25"', $result); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | |
78 | 78 | public function testSave() |
79 | 79 | { |
80 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' ); |
|
80 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'product'); |
|
81 | 81 | |
82 | - $item = $manager->findItem( 'CNC' ); |
|
83 | - $item->setCode( 'jqadm-test-physical' ); |
|
84 | - $item->setId( null ); |
|
82 | + $item = $manager->findItem('CNC'); |
|
83 | + $item->setCode('jqadm-test-physical'); |
|
84 | + $item->setId(null); |
|
85 | 85 | |
86 | - $manager->saveItem( $item ); |
|
86 | + $manager->saveItem($item); |
|
87 | 87 | |
88 | 88 | |
89 | 89 | $param = array( |
@@ -93,15 +93,15 @@ discard block |
||
93 | 93 | ), |
94 | 94 | ); |
95 | 95 | |
96 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
97 | - $this->view->addHelper( 'param', $helper ); |
|
96 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
97 | + $this->view->addHelper('param', $helper); |
|
98 | 98 | $this->view->item = $item; |
99 | 99 | |
100 | 100 | $result = $this->object->save(); |
101 | 101 | |
102 | - $manager->deleteItem( $item->getId() ); |
|
102 | + $manager->deleteItem($item->getId()); |
|
103 | 103 | |
104 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
105 | - $this->assertNull( $result ); |
|
104 | + $this->assertNull($this->view->get('errors')); |
|
105 | + $this->assertNull($result); |
|
106 | 106 | } |
107 | 107 | } |
@@ -22,39 +22,39 @@ discard block |
||
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | $templatePaths = \TestHelperJqadm::getTemplatePaths(); |
24 | 24 | |
25 | - $this->object = new \Aimeos\Admin\JQAdm\Product\Image\Standard( $this->context, $templatePaths ); |
|
26 | - $this->object->setView( $this->view ); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Product\Image\Standard($this->context, $templatePaths); |
|
26 | + $this->object->setView($this->view); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | |
30 | 30 | protected function tearDown() |
31 | 31 | { |
32 | - unset( $this->object ); |
|
32 | + unset($this->object); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
36 | 36 | public function testCreate() |
37 | 37 | { |
38 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' ); |
|
38 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'product'); |
|
39 | 39 | |
40 | 40 | $this->view->item = $manager->createItem(); |
41 | 41 | $result = $this->object->create(); |
42 | 42 | |
43 | - $this->assertContains( 'Images', $result ); |
|
44 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
43 | + $this->assertContains('Images', $result); |
|
44 | + $this->assertNull($this->view->get('errors')); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
48 | 48 | public function testCopy() |
49 | 49 | { |
50 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' ); |
|
50 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'product'); |
|
51 | 51 | |
52 | - $this->view->item = $manager->findItem( 'CNC', array( 'media' ) ); |
|
52 | + $this->view->item = $manager->findItem('CNC', array('media')); |
|
53 | 53 | $result = $this->object->copy(); |
54 | 54 | |
55 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
56 | - $this->assertContains( 'src="/prod_123x103/195_prod_123x103.jpg"', $result ); |
|
57 | - $this->assertContains( 'src="/prod_266x221/198_prod_266x221.jpg"', $result ); |
|
55 | + $this->assertNull($this->view->get('errors')); |
|
56 | + $this->assertContains('src="/prod_123x103/195_prod_123x103.jpg"', $result); |
|
57 | + $this->assertContains('src="/prod_266x221/198_prod_266x221.jpg"', $result); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | |
@@ -62,97 +62,97 @@ discard block |
||
62 | 62 | { |
63 | 63 | $result = $this->object->delete(); |
64 | 64 | |
65 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
66 | - $this->assertNull( $result ); |
|
65 | + $this->assertNull($this->view->get('errors')); |
|
66 | + $this->assertNull($result); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | |
70 | 70 | public function testGet() |
71 | 71 | { |
72 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' ); |
|
72 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'product'); |
|
73 | 73 | |
74 | - $this->view->item = $manager->findItem( 'CNC', array( 'media' ) ); |
|
74 | + $this->view->item = $manager->findItem('CNC', array('media')); |
|
75 | 75 | $result = $this->object->get(); |
76 | 76 | |
77 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
78 | - $this->assertContains( 'src="/prod_123x103/195_prod_123x103.jpg"', $result ); |
|
79 | - $this->assertContains( 'src="/prod_266x221/198_prod_266x221.jpg"', $result ); |
|
77 | + $this->assertNull($this->view->get('errors')); |
|
78 | + $this->assertContains('src="/prod_123x103/195_prod_123x103.jpg"', $result); |
|
79 | + $this->assertContains('src="/prod_266x221/198_prod_266x221.jpg"', $result); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | |
83 | 83 | public function testSave() |
84 | 84 | { |
85 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' ); |
|
85 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'product'); |
|
86 | 86 | |
87 | - $item = $manager->findItem( 'CNC' ); |
|
88 | - $item->setCode( 'jqadm-test-image' ); |
|
89 | - $item->setId( null ); |
|
87 | + $item = $manager->findItem('CNC'); |
|
88 | + $item->setCode('jqadm-test-image'); |
|
89 | + $item->setId(null); |
|
90 | 90 | |
91 | - $manager->saveItem( $item ); |
|
91 | + $manager->saveItem($item); |
|
92 | 92 | |
93 | 93 | |
94 | 94 | $param = array( |
95 | 95 | 'image' => array( |
96 | - 'product.lists.id' => array( '' ), |
|
97 | - 'media.languageid' => array( 'de' ), |
|
98 | - 'media.label' => array( 'test' ), |
|
96 | + 'product.lists.id' => array(''), |
|
97 | + 'media.languageid' => array('de'), |
|
98 | + 'media.label' => array('test'), |
|
99 | 99 | ), |
100 | 100 | ); |
101 | 101 | |
102 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
103 | - $this->view->addHelper( 'param', $helper ); |
|
102 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
103 | + $this->view->addHelper('param', $helper); |
|
104 | 104 | |
105 | - $file = $this->getMock( '\Psr\Http\Message\UploadedFileInterface' ); |
|
106 | - $request = $this->getMock( '\Psr\Http\Message\ServerRequestInterface' ); |
|
107 | - $request->expects( $this->any() )->method( 'getUploadedFiles' ) |
|
108 | - ->will( $this->returnValue( array( 'image' => array( 'files' => array( $file ) ) ) ) ); |
|
105 | + $file = $this->getMock('\Psr\Http\Message\UploadedFileInterface'); |
|
106 | + $request = $this->getMock('\Psr\Http\Message\ServerRequestInterface'); |
|
107 | + $request->expects($this->any())->method('getUploadedFiles') |
|
108 | + ->will($this->returnValue(array('image' => array('files' => array($file))))); |
|
109 | 109 | |
110 | - $helper = new \Aimeos\MW\View\Helper\Request\Standard( $this->view, $request, '127.0.0.1', 'test' ); |
|
111 | - $this->view ->addHelper( 'request', $helper ); |
|
110 | + $helper = new \Aimeos\MW\View\Helper\Request\Standard($this->view, $request, '127.0.0.1', 'test'); |
|
111 | + $this->view ->addHelper('request', $helper); |
|
112 | 112 | |
113 | 113 | $this->view->item = $item; |
114 | 114 | |
115 | 115 | |
116 | 116 | $name = 'AdminJQAdmProductImageSave'; |
117 | - $this->context->getConfig()->set( 'controller/common/media/name', $name ); |
|
117 | + $this->context->getConfig()->set('controller/common/media/name', $name); |
|
118 | 118 | |
119 | - $cntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Media\\Standard' ) |
|
120 | - ->setConstructorArgs( array( $this->context ) ) |
|
121 | - ->setMethods( array( 'add' ) ) |
|
119 | + $cntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Media\\Standard') |
|
120 | + ->setConstructorArgs(array($this->context)) |
|
121 | + ->setMethods(array('add')) |
|
122 | 122 | ->getMock(); |
123 | 123 | |
124 | - \Aimeos\Controller\Common\Media\Factory::injectController( '\\Aimeos\\Controller\\Common\\Media\\' . $name, $cntlStub ); |
|
124 | + \Aimeos\Controller\Common\Media\Factory::injectController('\\Aimeos\\Controller\\Common\\Media\\' . $name, $cntlStub); |
|
125 | 125 | |
126 | - $cntlStub->expects( $this->once() )->method( 'add' ); |
|
126 | + $cntlStub->expects($this->once())->method('add'); |
|
127 | 127 | |
128 | 128 | |
129 | - $mediaStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Media\\Manager\\Standard' ) |
|
130 | - ->setConstructorArgs( array( $this->context ) ) |
|
131 | - ->setMethods( array( 'saveItem' ) ) |
|
129 | + $mediaStub = $this->getMockBuilder('\\Aimeos\\MShop\\Media\\Manager\\Standard') |
|
130 | + ->setConstructorArgs(array($this->context)) |
|
131 | + ->setMethods(array('saveItem')) |
|
132 | 132 | ->getMock(); |
133 | 133 | |
134 | - \Aimeos\MShop\Factory::injectManager( $this->context, 'media', $mediaStub ); |
|
134 | + \Aimeos\MShop\Factory::injectManager($this->context, 'media', $mediaStub); |
|
135 | 135 | |
136 | - $mediaStub->expects( $this->once() )->method( 'saveItem' ); |
|
136 | + $mediaStub->expects($this->once())->method('saveItem'); |
|
137 | 137 | |
138 | 138 | |
139 | - \Aimeos\MShop\Factory::setCache( true ); |
|
139 | + \Aimeos\MShop\Factory::setCache(true); |
|
140 | 140 | |
141 | 141 | $result = $this->object->save(); |
142 | 142 | |
143 | - \Aimeos\MShop\Factory::setCache( false ); |
|
143 | + \Aimeos\MShop\Factory::setCache(false); |
|
144 | 144 | |
145 | - $item = $manager->getItem( $item->getId(), array( 'media' ) ); |
|
146 | - $manager->deleteItem( $item->getId() ); |
|
145 | + $item = $manager->getItem($item->getId(), array('media')); |
|
146 | + $manager->deleteItem($item->getId()); |
|
147 | 147 | |
148 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
149 | - $this->assertNull( $result ); |
|
150 | - $this->assertEquals( 1, count( $item->getListItems( 'media' ) ) ); |
|
148 | + $this->assertNull($this->view->get('errors')); |
|
149 | + $this->assertNull($result); |
|
150 | + $this->assertEquals(1, count($item->getListItems('media'))); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | |
154 | 154 | public function testSearch() |
155 | 155 | { |
156 | - $this->assertNull( $this->object->search() ); |
|
156 | + $this->assertNull($this->object->search()); |
|
157 | 157 | } |
158 | 158 | } |
@@ -22,40 +22,40 @@ discard block |
||
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | $templatePaths = \TestHelperJqadm::getTemplatePaths(); |
24 | 24 | |
25 | - $this->object = new \Aimeos\Admin\JQAdm\Product\Category\Standard( $this->context, $templatePaths ); |
|
26 | - $this->object->setView( $this->view ); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Product\Category\Standard($this->context, $templatePaths); |
|
26 | + $this->object->setView($this->view); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | |
30 | 30 | protected function tearDown() |
31 | 31 | { |
32 | - unset( $this->object ); |
|
32 | + unset($this->object); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
36 | 36 | public function testCreate() |
37 | 37 | { |
38 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' ); |
|
38 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'product'); |
|
39 | 39 | |
40 | 40 | $this->view->item = $manager->createItem(); |
41 | 41 | $result = $this->object->create(); |
42 | 42 | |
43 | - $this->assertContains( 'Categories', $result ); |
|
44 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
43 | + $this->assertContains('Categories', $result); |
|
44 | + $this->assertNull($this->view->get('errors')); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
48 | 48 | public function testCopy() |
49 | 49 | { |
50 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' ); |
|
50 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'product'); |
|
51 | 51 | |
52 | - $this->view->item = $manager->findItem( 'CNC' ); |
|
52 | + $this->view->item = $manager->findItem('CNC'); |
|
53 | 53 | $result = $this->object->copy(); |
54 | 54 | |
55 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
56 | - $this->assertContains( 'value="Internet"', $result ); |
|
57 | - $this->assertContains( 'value="Neu"', $result ); |
|
58 | - $this->assertContains( 'value="Kaffee"', $result ); |
|
55 | + $this->assertNull($this->view->get('errors')); |
|
56 | + $this->assertContains('value="Internet"', $result); |
|
57 | + $this->assertContains('value="Neu"', $result); |
|
58 | + $this->assertContains('value="Kaffee"', $result); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | |
@@ -63,105 +63,105 @@ discard block |
||
63 | 63 | { |
64 | 64 | $result = $this->object->delete(); |
65 | 65 | |
66 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
67 | - $this->assertNull( $result ); |
|
66 | + $this->assertNull($this->view->get('errors')); |
|
67 | + $this->assertNull($result); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | |
71 | 71 | public function testGet() |
72 | 72 | { |
73 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' ); |
|
73 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'product'); |
|
74 | 74 | |
75 | - $this->view->item = $manager->findItem( 'CNC' ); |
|
75 | + $this->view->item = $manager->findItem('CNC'); |
|
76 | 76 | $result = $this->object->get(); |
77 | 77 | |
78 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
79 | - $this->assertContains( 'value="Internet"', $result ); |
|
80 | - $this->assertContains( 'value="Neu"', $result ); |
|
81 | - $this->assertContains( 'value="Kaffee"', $result ); |
|
78 | + $this->assertNull($this->view->get('errors')); |
|
79 | + $this->assertContains('value="Internet"', $result); |
|
80 | + $this->assertContains('value="Neu"', $result); |
|
81 | + $this->assertContains('value="Kaffee"', $result); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | |
85 | 85 | public function testSave() |
86 | 86 | { |
87 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'catalog' ); |
|
88 | - $typeManager = \Aimeos\MShop\Factory::createManager( $this->context, 'catalog/lists/type' ); |
|
89 | - $productManager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' ); |
|
87 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'catalog'); |
|
88 | + $typeManager = \Aimeos\MShop\Factory::createManager($this->context, 'catalog/lists/type'); |
|
89 | + $productManager = \Aimeos\MShop\Factory::createManager($this->context, 'product'); |
|
90 | 90 | |
91 | - $item = $manager->findItem( 'root' ); |
|
92 | - $item->setCode( 'jqadm-test-root' ); |
|
93 | - $item->setId( null ); |
|
91 | + $item = $manager->findItem('root'); |
|
92 | + $item->setCode('jqadm-test-root'); |
|
93 | + $item->setId(null); |
|
94 | 94 | |
95 | - $manager->insertItem( $item ); |
|
95 | + $manager->insertItem($item); |
|
96 | 96 | |
97 | 97 | |
98 | - $typeid = $typeManager->findItem( 'default', array(), 'product' )->getId(); |
|
98 | + $typeid = $typeManager->findItem('default', array(), 'product')->getId(); |
|
99 | 99 | |
100 | 100 | $param = array( |
101 | 101 | 'category' => array( |
102 | - 'catalog.lists.id' => array( '' ), |
|
103 | - 'catalog.lists.typeid' => array( $typeid ), |
|
104 | - 'catalog.id' => array( $item->getId() ), |
|
102 | + 'catalog.lists.id' => array(''), |
|
103 | + 'catalog.lists.typeid' => array($typeid), |
|
104 | + 'catalog.id' => array($item->getId()), |
|
105 | 105 | ), |
106 | 106 | ); |
107 | 107 | |
108 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
109 | - $this->view->addHelper( 'param', $helper ); |
|
108 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
109 | + $this->view->addHelper('param', $helper); |
|
110 | 110 | $this->view->item = $productManager->createItem(); |
111 | 111 | |
112 | 112 | $result = $this->object->save(); |
113 | 113 | |
114 | - $item = $manager->getItem( $item->getId(), array( 'product' ) ); |
|
115 | - $manager->deleteItem( $item->getId() ); |
|
114 | + $item = $manager->getItem($item->getId(), array('product')); |
|
115 | + $manager->deleteItem($item->getId()); |
|
116 | 116 | |
117 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
118 | - $this->assertNull( $result ); |
|
119 | - $this->assertEquals( 1, count( $item->getListItems( 'product' ) ) ); |
|
117 | + $this->assertNull($this->view->get('errors')); |
|
118 | + $this->assertNull($result); |
|
119 | + $this->assertEquals(1, count($item->getListItems('product'))); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | |
123 | 123 | public function testSavePromotion() |
124 | 124 | { |
125 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'catalog' ); |
|
126 | - $typeManager = \Aimeos\MShop\Factory::createManager( $this->context, 'catalog/lists/type' ); |
|
127 | - $productManager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' ); |
|
125 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'catalog'); |
|
126 | + $typeManager = \Aimeos\MShop\Factory::createManager($this->context, 'catalog/lists/type'); |
|
127 | + $productManager = \Aimeos\MShop\Factory::createManager($this->context, 'product'); |
|
128 | 128 | |
129 | - $item = $manager->findItem( 'root' ); |
|
130 | - $item->setCode( 'jqadm-test-root' ); |
|
131 | - $item->setId( null ); |
|
129 | + $item = $manager->findItem('root'); |
|
130 | + $item->setCode('jqadm-test-root'); |
|
131 | + $item->setId(null); |
|
132 | 132 | |
133 | - $manager->insertItem( $item ); |
|
133 | + $manager->insertItem($item); |
|
134 | 134 | |
135 | 135 | |
136 | - $typeid = $typeManager->findItem( 'promotion', array(), 'product' )->getId(); |
|
136 | + $typeid = $typeManager->findItem('promotion', array(), 'product')->getId(); |
|
137 | 137 | |
138 | 138 | $param = array( |
139 | 139 | 'category' => array( |
140 | - 'catalog.lists.id' => array( '' ), |
|
141 | - 'catalog.lists.typeid' => array( $typeid ), |
|
142 | - 'catalog.id' => array( $item->getId() ), |
|
140 | + 'catalog.lists.id' => array(''), |
|
141 | + 'catalog.lists.typeid' => array($typeid), |
|
142 | + 'catalog.id' => array($item->getId()), |
|
143 | 143 | ), |
144 | 144 | ); |
145 | 145 | |
146 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
147 | - $this->view->addHelper( 'param', $helper ); |
|
146 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
147 | + $this->view->addHelper('param', $helper); |
|
148 | 148 | $this->view->item = $productManager->createItem(); |
149 | 149 | |
150 | 150 | $result = $this->object->save(); |
151 | 151 | |
152 | - $item = $manager->getItem( $item->getId(), array( 'product' ) ); |
|
153 | - $listItems = $item->getListItems( 'product' ); |
|
154 | - $manager->deleteItem( $item->getId() ); |
|
152 | + $item = $manager->getItem($item->getId(), array('product')); |
|
153 | + $listItems = $item->getListItems('product'); |
|
154 | + $manager->deleteItem($item->getId()); |
|
155 | 155 | |
156 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
157 | - $this->assertNull( $result ); |
|
158 | - $this->assertEquals( 1, count( $listItems ) ); |
|
159 | - $this->assertEquals( $typeid, reset( $listItems )->getTypeId() ); |
|
156 | + $this->assertNull($this->view->get('errors')); |
|
157 | + $this->assertNull($result); |
|
158 | + $this->assertEquals(1, count($listItems)); |
|
159 | + $this->assertEquals($typeid, reset($listItems)->getTypeId()); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | |
163 | 163 | public function testSearch() |
164 | 164 | { |
165 | - $this->assertNull( $this->object->search() ); |
|
165 | + $this->assertNull($this->object->search()); |
|
166 | 166 | } |
167 | 167 | } |
@@ -19,45 +19,45 @@ |
||
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\Category\Standard' ) |
|
28 | - ->setMethods( array( 'save' ) ) |
|
27 | + $this->mock = $this->getMockBuilder('Aimeos\Admin\JQAdm\Product\Category\Standard') |
|
28 | + ->setMethods(array('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\Product\Category\Decorator\Cache( $this->mock, $this->context, $templatePaths ); |
|
36 | + $this->object = new \Aimeos\Admin\JQAdm\Product\Category\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 testSave() |
47 | 47 | { |
48 | 48 | $view = \TestHelperJqadm::getView(); |
49 | - $tags = array( 'catalog', 'catalog-1', 'catalog-2' ); |
|
49 | + $tags = array('catalog', 'catalog-1', 'catalog-2'); |
|
50 | 50 | |
51 | - $param = array( 'category' => array( 'catalog.id' => array( '1', '2' ) ) ); |
|
52 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
53 | - $view->addHelper( 'param', $helper ); |
|
51 | + $param = array('category' => array('catalog.id' => array('1', '2'))); |
|
52 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
53 | + $view->addHelper('param', $helper); |
|
54 | 54 | |
55 | - $this->cache->expects( $this->once() )->method( 'deleteByTags' )->with( $this->equalTo( $tags ) ); |
|
56 | - $this->mock->expects( $this->once() )->method( 'save' )->will( $this->returnValue( 'test' ) ); |
|
55 | + $this->cache->expects($this->once())->method('deleteByTags')->with($this->equalTo($tags)); |
|
56 | + $this->mock->expects($this->once())->method('save')->will($this->returnValue('test')); |
|
57 | 57 | |
58 | - $this->object->setView( $view ); |
|
58 | + $this->object->setView($view); |
|
59 | 59 | $result = $this->object->save(); |
60 | 60 | |
61 | - $this->assertEquals( 'test', $result ); |
|
61 | + $this->assertEquals('test', $result); |
|
62 | 62 | } |
63 | 63 | } |
@@ -19,44 +19,44 @@ |
||
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( 'save' ) ) |
|
27 | + $this->mock = $this->getMockBuilder('Aimeos\Admin\JQAdm\Product\Standard') |
|
28 | + ->setMethods(array('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 testSave() |
47 | 47 | { |
48 | - $item = \Aimeos\MShop\Factory::createManager( $this->context, 'product' )->findItem( 'CNC' ); |
|
48 | + $item = \Aimeos\MShop\Factory::createManager($this->context, 'product')->findItem('CNC'); |
|
49 | 49 | |
50 | - $tags = array( 'product', 'product-' . $item->getId() ); |
|
50 | + $tags = array('product', 'product-' . $item->getId()); |
|
51 | 51 | $view = \TestHelperJqadm::getView(); |
52 | 52 | $view->item = $item; |
53 | 53 | |
54 | - $this->cache->expects( $this->once() )->method( 'deleteByTags' )->with( $this->equalTo( $tags ) ); |
|
55 | - $this->mock->expects( $this->once() )->method( 'save' )->will( $this->returnValue( 'test' ) ); |
|
54 | + $this->cache->expects($this->once())->method('deleteByTags')->with($this->equalTo($tags)); |
|
55 | + $this->mock->expects($this->once())->method('save')->will($this->returnValue('test')); |
|
56 | 56 | |
57 | - $this->object->setView( $view ); |
|
57 | + $this->object->setView($view); |
|
58 | 58 | $result = $this->object->save(); |
59 | 59 | |
60 | - $this->assertEquals( 'test', $result ); |
|
60 | + $this->assertEquals('test', $result); |
|
61 | 61 | } |
62 | 62 | } |
@@ -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\Page( $client, $this->context, $templatePaths ); |
|
23 | + $client = new \Aimeos\Admin\JQAdm\Product\Standard($this->context, $templatePaths); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($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,9 +35,9 @@ 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->pageSites ); |
|
41 | - $this->assertInternalType( 'array', $view->pageLanguages ); |
|
40 | + $this->assertInternalType('array', $view->pageSites); |
|
41 | + $this->assertInternalType('array', $view->pageLanguages); |
|
42 | 42 | } |
43 | 43 | } |
@@ -21,31 +21,31 @@ |
||
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( 'save' ) ) |
|
24 | + $this->mock = $this->getMockBuilder('Aimeos\Admin\JQAdm\Product\Standard') |
|
25 | + ->setMethods(array('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 testSave() |
40 | 40 | { |
41 | 41 | $view = \TestHelperJqadm::getView(); |
42 | - $view->item = \Aimeos\MShop\Factory::createManager( $this->context, 'product' )->findItem( 'CNC' ); |
|
42 | + $view->item = \Aimeos\MShop\Factory::createManager($this->context, 'product')->findItem('CNC'); |
|
43 | 43 | |
44 | - $this->mock->expects( $this->once() )->method( 'save' )->will( $this->returnValue( 'test' ) ); |
|
45 | - $this->object->setView( $view ); |
|
44 | + $this->mock->expects($this->once())->method('save')->will($this->returnValue('test')); |
|
45 | + $this->object->setView($view); |
|
46 | 46 | |
47 | 47 | $result = $this->object->save(); |
48 | 48 | |
49 | - $this->assertEquals( 'test', $result ); |
|
49 | + $this->assertEquals('test', $result); |
|
50 | 50 | } |
51 | 51 | } |