@@ -21,40 +21,40 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Product\Characteristic\Property\Standard( $this->context ); |
|
25 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
26 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
27 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Product\Characteristic\Property\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
37 | 37 | public function testCreate() |
38 | 38 | { |
39 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
39 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
40 | 40 | |
41 | 41 | $this->view->item = $manager->createItem(); |
42 | 42 | $result = $this->object->create(); |
43 | 43 | |
44 | - $this->assertContains( 'Properties', $result ); |
|
45 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
44 | + $this->assertContains('Properties', $result); |
|
45 | + $this->assertNull($this->view->get('errors')); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | |
49 | 49 | public function testCopy() |
50 | 50 | { |
51 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
51 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
52 | 52 | |
53 | - $this->view->item = $manager->findItem( 'CNC' ); |
|
53 | + $this->view->item = $manager->findItem('CNC'); |
|
54 | 54 | $result = $this->object->copy(); |
55 | 55 | |
56 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
57 | - $this->assertContains( 'Properties', $result ); |
|
56 | + $this->assertNull($this->view->get('errors')); |
|
57 | + $this->assertContains('Properties', $result); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | |
@@ -62,26 +62,26 @@ 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::create( $this->context, 'product' ); |
|
72 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
73 | 73 | |
74 | - $this->view->item = $manager->findItem( 'CNC' ); |
|
74 | + $this->view->item = $manager->findItem('CNC'); |
|
75 | 75 | $result = $this->object->get(); |
76 | 76 | |
77 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
78 | - $this->assertContains( 'Properties', $result ); |
|
77 | + $this->assertNull($this->view->get('errors')); |
|
78 | + $this->assertContains('Properties', $result); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
82 | 82 | public function testSave() |
83 | 83 | { |
84 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
84 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
85 | 85 | $this->view->item = $manager->createItem(); |
86 | 86 | |
87 | 87 | $param = array( |
@@ -97,50 +97,50 @@ discard block |
||
97 | 97 | ), |
98 | 98 | ); |
99 | 99 | |
100 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
101 | - $this->view->addHelper( 'param', $helper ); |
|
100 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
101 | + $this->view->addHelper('param', $helper); |
|
102 | 102 | |
103 | 103 | $result = $this->object->save(); |
104 | 104 | |
105 | - $items = $this->view->item->getPropertyItems( null, false ); |
|
105 | + $items = $this->view->item->getPropertyItems(null, false); |
|
106 | 106 | |
107 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
108 | - $this->assertNull( $result ); |
|
109 | - $this->assertEquals( 1, count( $items ) ); |
|
110 | - $this->assertEquals( null, reset( $items )->getLanguageId() ); |
|
111 | - $this->assertEquals( '#100000', reset( $items )->getValue() ); |
|
107 | + $this->assertNull($this->view->get('errors')); |
|
108 | + $this->assertNull($result); |
|
109 | + $this->assertEquals(1, count($items)); |
|
110 | + $this->assertEquals(null, reset($items)->getLanguageId()); |
|
111 | + $this->assertEquals('#100000', reset($items)->getValue()); |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | |
115 | 115 | public function testSaveException() |
116 | 116 | { |
117 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Characteristic\Property\Standard::class ) |
|
118 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
119 | - ->setMethods( array( 'fromArray' ) ) |
|
117 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Characteristic\Property\Standard::class) |
|
118 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
119 | + ->setMethods(array('fromArray')) |
|
120 | 120 | ->getMock(); |
121 | 121 | |
122 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
123 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
122 | + $object->expects($this->once())->method('fromArray') |
|
123 | + ->will($this->throwException(new \RuntimeException())); |
|
124 | 124 | |
125 | 125 | $this->view = \TestHelperJqadm::getView(); |
126 | - $this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem(); |
|
126 | + $this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem(); |
|
127 | 127 | |
128 | - $object->setView( $this->view ); |
|
128 | + $object->setView($this->view); |
|
129 | 129 | |
130 | - $this->setExpectedException( \RuntimeException::class ); |
|
130 | + $this->setExpectedException(\RuntimeException::class); |
|
131 | 131 | $object->save(); |
132 | 132 | } |
133 | 133 | |
134 | 134 | |
135 | 135 | public function testSearch() |
136 | 136 | { |
137 | - $this->assertNull( $this->object->search() ); |
|
137 | + $this->assertNull($this->object->search()); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | |
141 | 141 | public function testGetSubClient() |
142 | 142 | { |
143 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
144 | - $this->object->getSubClient( 'unknown' ); |
|
143 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
144 | + $this->object->getSubClient('unknown'); |
|
145 | 145 | } |
146 | 146 | } |
@@ -21,40 +21,40 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Product\Characteristic\Variant\Standard( $this->context ); |
|
25 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
26 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
27 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Product\Characteristic\Variant\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
37 | 37 | public function testCreate() |
38 | 38 | { |
39 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
39 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
40 | 40 | |
41 | 41 | $this->view->item = $manager->createItem(); |
42 | 42 | $result = $this->object->create(); |
43 | 43 | |
44 | - $this->assertContains( 'Variant attributes', $result ); |
|
45 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
44 | + $this->assertContains('Variant attributes', $result); |
|
45 | + $this->assertNull($this->view->get('errors')); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | |
49 | 49 | public function testCopy() |
50 | 50 | { |
51 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
51 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
52 | 52 | |
53 | - $this->view->item = $manager->findItem( 'U:TESTSUB04', ['attribute'] ); |
|
53 | + $this->view->item = $manager->findItem('U:TESTSUB04', ['attribute']); |
|
54 | 54 | $result = $this->object->copy(); |
55 | 55 | |
56 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
57 | - $this->assertContains( '30', $result ); |
|
56 | + $this->assertNull($this->view->get('errors')); |
|
57 | + $this->assertContains('30', $result); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | |
@@ -62,61 +62,61 @@ 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::create( $this->context, 'product' ); |
|
72 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
73 | 73 | |
74 | - $this->view->item = $manager->findItem( 'U:TESTSUB04', ['attribute'] ); |
|
74 | + $this->view->item = $manager->findItem('U:TESTSUB04', ['attribute']); |
|
75 | 75 | $result = $this->object->get(); |
76 | 76 | |
77 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
78 | - $this->assertContains( '30', $result ); |
|
77 | + $this->assertNull($this->view->get('errors')); |
|
78 | + $this->assertContains('30', $result); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
82 | 82 | public function testSave() |
83 | 83 | { |
84 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
84 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
85 | 85 | $this->view->item = $manager->createItem(); |
86 | 86 | |
87 | 87 | $param = array( |
88 | 88 | 'site' => 'unittest', |
89 | 89 | 'characteristic' => array( |
90 | 90 | 'variant' => array( |
91 | - 'product.lists.id' => array( '' ), |
|
92 | - 'product.lists.refid' => array( '123' ), |
|
91 | + 'product.lists.id' => array(''), |
|
92 | + 'product.lists.refid' => array('123'), |
|
93 | 93 | ), |
94 | 94 | ), |
95 | 95 | ); |
96 | 96 | |
97 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
98 | - $this->view->addHelper( 'param', $helper ); |
|
97 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
98 | + $this->view->addHelper('param', $helper); |
|
99 | 99 | |
100 | 100 | $result = $this->object->save(); |
101 | 101 | |
102 | - $attributes = $this->view->item->getListItems( 'attribute' ); |
|
102 | + $attributes = $this->view->item->getListItems('attribute'); |
|
103 | 103 | |
104 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
105 | - $this->assertNull( $result ); |
|
106 | - $this->assertEquals( 1, count( $attributes ) ); |
|
107 | - $this->assertEquals( '123', reset( $attributes )->getRefId() ); |
|
104 | + $this->assertNull($this->view->get('errors')); |
|
105 | + $this->assertNull($result); |
|
106 | + $this->assertEquals(1, count($attributes)); |
|
107 | + $this->assertEquals('123', reset($attributes)->getRefId()); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | |
111 | 111 | public function testSearch() |
112 | 112 | { |
113 | - $this->assertNull( $this->object->search() ); |
|
113 | + $this->assertNull($this->object->search()); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | |
117 | 117 | public function testGetSubClient() |
118 | 118 | { |
119 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
120 | - $this->object->getSubClient( 'unknown' ); |
|
119 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
120 | + $this->object->getSubClient('unknown'); |
|
121 | 121 | } |
122 | 122 | } |
@@ -21,138 +21,138 @@ |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Product\Stock\Standard( $this->context ); |
|
25 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
26 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
27 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Product\Stock\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
37 | 37 | public function testCreate() |
38 | 38 | { |
39 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
39 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
40 | 40 | |
41 | 41 | $this->view->item = $manager->createItem(); |
42 | 42 | $result = $this->object->create(); |
43 | 43 | |
44 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
45 | - $this->assertContains( 'item-stock', $result ); |
|
44 | + $this->assertNull($this->view->get('errors')); |
|
45 | + $this->assertContains('item-stock', $result); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | |
49 | 49 | public function testCopy() |
50 | 50 | { |
51 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
51 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
52 | 52 | |
53 | - $this->view->item = $manager->findItem( 'CNC' ); |
|
53 | + $this->view->item = $manager->findItem('CNC'); |
|
54 | 54 | $result = $this->object->copy(); |
55 | 55 | |
56 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
57 | - $this->assertContains( '"stock.stocklevel":[1200]', $result ); |
|
58 | - $this->assertContains( '"stock.dateback":["2015-05-01T00:00:00"]', $result ); |
|
56 | + $this->assertNull($this->view->get('errors')); |
|
57 | + $this->assertContains('"stock.stocklevel":[1200]', $result); |
|
58 | + $this->assertContains('"stock.dateback":["2015-05-01T00:00:00"]', $result); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | |
62 | 62 | public function testGet() |
63 | 63 | { |
64 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
64 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
65 | 65 | |
66 | - $this->view->item = $manager->findItem( 'CNC' ); |
|
66 | + $this->view->item = $manager->findItem('CNC'); |
|
67 | 67 | $result = $this->object->get(); |
68 | 68 | |
69 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
70 | - $this->assertContains( '"stock.stocklevel":[1200]', $result ); |
|
71 | - $this->assertContains( '"stock.dateback":["2015-05-01T00:00:00"]', $result ); |
|
69 | + $this->assertNull($this->view->get('errors')); |
|
70 | + $this->assertContains('"stock.stocklevel":[1200]', $result); |
|
71 | + $this->assertContains('"stock.dateback":["2015-05-01T00:00:00"]', $result); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | |
75 | 75 | public function testSave() |
76 | 76 | { |
77 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
78 | - $stockManager = \Aimeos\MShop::create( $this->context, 'stock' ); |
|
77 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
78 | + $stockManager = \Aimeos\MShop::create($this->context, 'stock'); |
|
79 | 79 | |
80 | - $item = $manager->findItem( 'CNC' ); |
|
81 | - $item->setCode( 'jqadm-test-stock' ); |
|
82 | - $item->setId( null ); |
|
80 | + $item = $manager->findItem('CNC'); |
|
81 | + $item->setCode('jqadm-test-stock'); |
|
82 | + $item->setId(null); |
|
83 | 83 | |
84 | - $item = $manager->saveItem( $item ); |
|
84 | + $item = $manager->saveItem($item); |
|
85 | 85 | |
86 | 86 | |
87 | 87 | $param = array( |
88 | 88 | 'site' => 'unittest', |
89 | 89 | 'stock' => array( |
90 | - 'stock.id' => array( '' ), |
|
91 | - 'stock.type' => array( 'default' ), |
|
92 | - 'stock.dateback' => array( '2000-01-01 00:00:00' ), |
|
93 | - 'stock.stocklevel' => array( '-1' ), |
|
90 | + 'stock.id' => array(''), |
|
91 | + 'stock.type' => array('default'), |
|
92 | + 'stock.dateback' => array('2000-01-01 00:00:00'), |
|
93 | + 'stock.stocklevel' => array('-1'), |
|
94 | 94 | ), |
95 | 95 | ); |
96 | 96 | |
97 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
98 | - $this->view->addHelper( 'param', $helper ); |
|
97 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
98 | + $this->view->addHelper('param', $helper); |
|
99 | 99 | $this->view->item = $item; |
100 | 100 | |
101 | 101 | $result = $this->object->save(); |
102 | 102 | |
103 | 103 | $search = $stockManager->createSearch(); |
104 | - $search->setConditions( $search->compare( '==', 'stock.productcode', 'jqadm-test-stock' ) ); |
|
105 | - $stockManager->deleteItems( array_keys( $stockManager->searchItems( $search ) ) ); |
|
106 | - $manager->deleteItem( $item->getId() ); |
|
104 | + $search->setConditions($search->compare('==', 'stock.productcode', 'jqadm-test-stock')); |
|
105 | + $stockManager->deleteItems(array_keys($stockManager->searchItems($search))); |
|
106 | + $manager->deleteItem($item->getId()); |
|
107 | 107 | |
108 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
109 | - $this->assertNull( $result ); |
|
108 | + $this->assertNull($this->view->get('errors')); |
|
109 | + $this->assertNull($result); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | |
113 | 113 | public function testSaveException() |
114 | 114 | { |
115 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Stock\Standard::class ) |
|
116 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
117 | - ->setMethods( array( 'fromArray' ) ) |
|
115 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Stock\Standard::class) |
|
116 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
117 | + ->setMethods(array('fromArray')) |
|
118 | 118 | ->getMock(); |
119 | 119 | |
120 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
121 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
120 | + $object->expects($this->once())->method('fromArray') |
|
121 | + ->will($this->throwException(new \RuntimeException())); |
|
122 | 122 | |
123 | 123 | $this->view = \TestHelperJqadm::getView(); |
124 | - $this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem(); |
|
124 | + $this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem(); |
|
125 | 125 | |
126 | - $object->setView( $this->view ); |
|
126 | + $object->setView($this->view); |
|
127 | 127 | |
128 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
128 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
129 | 129 | $object->save(); |
130 | 130 | } |
131 | 131 | |
132 | 132 | |
133 | 133 | public function testSaveMShopException() |
134 | 134 | { |
135 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Stock\Standard::class ) |
|
136 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
137 | - ->setMethods( array( 'fromArray' ) ) |
|
135 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Stock\Standard::class) |
|
136 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
137 | + ->setMethods(array('fromArray')) |
|
138 | 138 | ->getMock(); |
139 | 139 | |
140 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
141 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
140 | + $object->expects($this->once())->method('fromArray') |
|
141 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
142 | 142 | |
143 | 143 | $this->view = \TestHelperJqadm::getView(); |
144 | - $this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem(); |
|
144 | + $this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem(); |
|
145 | 145 | |
146 | - $object->setView( $this->view ); |
|
146 | + $object->setView($this->view); |
|
147 | 147 | |
148 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
148 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
149 | 149 | $object->save(); |
150 | 150 | } |
151 | 151 | |
152 | 152 | |
153 | 153 | public function testGetSubClient() |
154 | 154 | { |
155 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
156 | - $this->object->getSubClient( 'unknown' ); |
|
155 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
156 | + $this->object->getSubClient('unknown'); |
|
157 | 157 | } |
158 | 158 | } |
@@ -21,42 +21,42 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Product\Category\Standard( $this->context ); |
|
25 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
26 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
27 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Product\Category\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
37 | 37 | public function testCreate() |
38 | 38 | { |
39 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
39 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
40 | 40 | |
41 | 41 | $this->view->item = $manager->createItem(); |
42 | 42 | $result = $this->object->create(); |
43 | 43 | |
44 | - $this->assertContains( 'item-category', $result ); |
|
45 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
44 | + $this->assertContains('item-category', $result); |
|
45 | + $this->assertNull($this->view->get('errors')); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | |
49 | 49 | public function testCopy() |
50 | 50 | { |
51 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
51 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
52 | 52 | |
53 | - $this->view->item = $manager->findItem( 'CNC' ); |
|
53 | + $this->view->item = $manager->findItem('CNC'); |
|
54 | 54 | $result = $this->object->copy(); |
55 | 55 | |
56 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
57 | - $this->assertRegexp( '/"catalog.label":\[.*"Internet".*\]/', $result ); |
|
58 | - $this->assertRegexp( '/"catalog.label":\[.*"Kaffee".*\]/', $result ); |
|
59 | - $this->assertRegexp( '/"catalog.label":\[.*"Neu".*\]/', $result ); |
|
56 | + $this->assertNull($this->view->get('errors')); |
|
57 | + $this->assertRegexp('/"catalog.label":\[.*"Internet".*\]/', $result); |
|
58 | + $this->assertRegexp('/"catalog.label":\[.*"Kaffee".*\]/', $result); |
|
59 | + $this->assertRegexp('/"catalog.label":\[.*"Neu".*\]/', $result); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | |
@@ -64,146 +64,146 @@ discard block |
||
64 | 64 | { |
65 | 65 | $result = $this->object->delete(); |
66 | 66 | |
67 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
68 | - $this->assertNull( $result ); |
|
67 | + $this->assertNull($this->view->get('errors')); |
|
68 | + $this->assertNull($result); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | |
72 | 72 | public function testGet() |
73 | 73 | { |
74 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
74 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
75 | 75 | |
76 | - $this->view->item = $manager->findItem( 'CNC' ); |
|
76 | + $this->view->item = $manager->findItem('CNC'); |
|
77 | 77 | $result = $this->object->get(); |
78 | 78 | |
79 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
80 | - $this->assertRegexp( '/"catalog.label":\[.*"Internet".*\]/', $result ); |
|
81 | - $this->assertRegexp( '/"catalog.label":\[.*"Kaffee".*\]/', $result ); |
|
82 | - $this->assertRegexp( '/"catalog.label":\[.*"Neu".*\]/', $result ); |
|
79 | + $this->assertNull($this->view->get('errors')); |
|
80 | + $this->assertRegexp('/"catalog.label":\[.*"Internet".*\]/', $result); |
|
81 | + $this->assertRegexp('/"catalog.label":\[.*"Kaffee".*\]/', $result); |
|
82 | + $this->assertRegexp('/"catalog.label":\[.*"Neu".*\]/', $result); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | |
86 | 86 | public function testSave() |
87 | 87 | { |
88 | - $manager = \Aimeos\MShop::create( $this->context, 'catalog' ); |
|
89 | - $productManager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
88 | + $manager = \Aimeos\MShop::create($this->context, 'catalog'); |
|
89 | + $productManager = \Aimeos\MShop::create($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 | 98 | $param = array( |
99 | 99 | 'site' => 'unittest', |
100 | 100 | 'category' => array( |
101 | - 'catalog.lists.id' => array( '' ), |
|
102 | - 'catalog.lists.type' => array( 'default' ), |
|
103 | - 'catalog.id' => array( $item->getId() ), |
|
101 | + 'catalog.lists.id' => array(''), |
|
102 | + 'catalog.lists.type' => array('default'), |
|
103 | + 'catalog.id' => array($item->getId()), |
|
104 | 104 | ), |
105 | 105 | ); |
106 | 106 | |
107 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
108 | - $this->view->addHelper( 'param', $helper ); |
|
107 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
108 | + $this->view->addHelper('param', $helper); |
|
109 | 109 | $this->view->item = $productManager->createItem(); |
110 | 110 | |
111 | 111 | $result = $this->object->save(); |
112 | 112 | |
113 | - $item = $manager->getItem( $item->getId(), array( 'product' ) ); |
|
114 | - $manager->deleteItem( $item->getId() ); |
|
113 | + $item = $manager->getItem($item->getId(), array('product')); |
|
114 | + $manager->deleteItem($item->getId()); |
|
115 | 115 | |
116 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
117 | - $this->assertNull( $result ); |
|
118 | - $this->assertEquals( 1, count( $item->getListItems( 'product' ) ) ); |
|
116 | + $this->assertNull($this->view->get('errors')); |
|
117 | + $this->assertNull($result); |
|
118 | + $this->assertEquals(1, count($item->getListItems('product'))); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | |
122 | 122 | public function testSavePromotion() |
123 | 123 | { |
124 | - $manager = \Aimeos\MShop::create( $this->context, 'catalog' ); |
|
125 | - $productManager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
124 | + $manager = \Aimeos\MShop::create($this->context, 'catalog'); |
|
125 | + $productManager = \Aimeos\MShop::create($this->context, 'product'); |
|
126 | 126 | |
127 | - $item = $manager->findItem( 'root' ); |
|
128 | - $item->setCode( 'jqadm-test-root' ); |
|
129 | - $item->setId( null ); |
|
127 | + $item = $manager->findItem('root'); |
|
128 | + $item->setCode('jqadm-test-root'); |
|
129 | + $item->setId(null); |
|
130 | 130 | |
131 | - $manager->insertItem( $item ); |
|
131 | + $manager->insertItem($item); |
|
132 | 132 | |
133 | 133 | |
134 | 134 | $param = array( |
135 | 135 | 'category' => array( |
136 | - 'catalog.lists.id' => array( '' ), |
|
137 | - 'catalog.lists.type' => array( 'promotion' ), |
|
138 | - 'catalog.id' => array( $item->getId() ), |
|
136 | + 'catalog.lists.id' => array(''), |
|
137 | + 'catalog.lists.type' => array('promotion'), |
|
138 | + 'catalog.id' => array($item->getId()), |
|
139 | 139 | ), |
140 | 140 | ); |
141 | 141 | |
142 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
143 | - $this->view->addHelper( 'param', $helper ); |
|
142 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
143 | + $this->view->addHelper('param', $helper); |
|
144 | 144 | $this->view->item = $productManager->createItem(); |
145 | 145 | |
146 | 146 | $result = $this->object->save(); |
147 | 147 | |
148 | - $item = $manager->getItem( $item->getId(), array( 'product' ) ); |
|
149 | - $listItems = $item->getListItems( 'product' ); |
|
150 | - $manager->deleteItem( $item->getId() ); |
|
148 | + $item = $manager->getItem($item->getId(), array('product')); |
|
149 | + $listItems = $item->getListItems('product'); |
|
150 | + $manager->deleteItem($item->getId()); |
|
151 | 151 | |
152 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
153 | - $this->assertNull( $result ); |
|
154 | - $this->assertEquals( 1, count( $listItems ) ); |
|
152 | + $this->assertNull($this->view->get('errors')); |
|
153 | + $this->assertNull($result); |
|
154 | + $this->assertEquals(1, count($listItems)); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | |
158 | 158 | public function testSaveException() |
159 | 159 | { |
160 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Category\Standard::class ) |
|
161 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
162 | - ->setMethods( array( 'fromArray' ) ) |
|
160 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Category\Standard::class) |
|
161 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
162 | + ->setMethods(array('fromArray')) |
|
163 | 163 | ->getMock(); |
164 | 164 | |
165 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
166 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
165 | + $object->expects($this->once())->method('fromArray') |
|
166 | + ->will($this->throwException(new \RuntimeException())); |
|
167 | 167 | |
168 | 168 | $this->view = \TestHelperJqadm::getView(); |
169 | - $this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem(); |
|
169 | + $this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem(); |
|
170 | 170 | |
171 | - $object->setView( $this->view ); |
|
171 | + $object->setView($this->view); |
|
172 | 172 | |
173 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
173 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
174 | 174 | $object->save(); |
175 | 175 | } |
176 | 176 | |
177 | 177 | |
178 | 178 | public function testSaveMShopException() |
179 | 179 | { |
180 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Category\Standard::class ) |
|
181 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
182 | - ->setMethods( array( 'fromArray' ) ) |
|
180 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Category\Standard::class) |
|
181 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
182 | + ->setMethods(array('fromArray')) |
|
183 | 183 | ->getMock(); |
184 | 184 | |
185 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
186 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
185 | + $object->expects($this->once())->method('fromArray') |
|
186 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
187 | 187 | |
188 | 188 | $this->view = \TestHelperJqadm::getView(); |
189 | - $this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem(); |
|
189 | + $this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem(); |
|
190 | 190 | |
191 | - $object->setView( $this->view ); |
|
191 | + $object->setView($this->view); |
|
192 | 192 | |
193 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
193 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
194 | 194 | $object->save(); |
195 | 195 | } |
196 | 196 | |
197 | 197 | |
198 | 198 | public function testSearch() |
199 | 199 | { |
200 | - $this->assertNull( $this->object->search() ); |
|
200 | + $this->assertNull($this->object->search()); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | |
204 | 204 | public function testGetSubClient() |
205 | 205 | { |
206 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
207 | - $this->object->getSubClient( 'unknown' ); |
|
206 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
207 | + $this->object->getSubClient('unknown'); |
|
208 | 208 | } |
209 | 209 | } |
@@ -21,40 +21,40 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Product\Special\Standard( $this->context ); |
|
25 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
26 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
27 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Product\Special\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
37 | 37 | public function testCreate() |
38 | 38 | { |
39 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
39 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
40 | 40 | |
41 | 41 | $this->view->item = $manager->createItem(); |
42 | 42 | $result = $this->object->create(); |
43 | 43 | |
44 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
45 | - $this->assertContains( 'item-special', $result ); |
|
44 | + $this->assertNull($this->view->get('errors')); |
|
45 | + $this->assertContains('item-special', $result); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | |
49 | 49 | public function testCopy() |
50 | 50 | { |
51 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
51 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
52 | 52 | |
53 | - $this->view->item = $manager->findItem( 'U:TESTP' ); |
|
53 | + $this->view->item = $manager->findItem('U:TESTP'); |
|
54 | 54 | $result = $this->object->copy(); |
55 | 55 | |
56 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
57 | - $this->assertContains( 'item-special', $result ); |
|
56 | + $this->assertNull($this->view->get('errors')); |
|
57 | + $this->assertContains('item-special', $result); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | |
@@ -62,92 +62,92 @@ 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::create( $this->context, 'product' ); |
|
72 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
73 | 73 | |
74 | - $this->view->item = $manager->findItem( 'U:TESTP' ); |
|
74 | + $this->view->item = $manager->findItem('U:TESTP'); |
|
75 | 75 | $result = $this->object->get(); |
76 | 76 | |
77 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
78 | - $this->assertContains( 'item-special', $result ); |
|
77 | + $this->assertNull($this->view->get('errors')); |
|
78 | + $this->assertContains('item-special', $result); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
82 | 82 | public function testSave() |
83 | 83 | { |
84 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
84 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
85 | 85 | |
86 | - $item = $manager->findItem( 'U:TESTP' ); |
|
87 | - $item->setCode( 'jqadm-test-special' ); |
|
88 | - $item->setId( null ); |
|
86 | + $item = $manager->findItem('U:TESTP'); |
|
87 | + $item->setCode('jqadm-test-special'); |
|
88 | + $item->setId(null); |
|
89 | 89 | |
90 | - $item = $manager->saveItem( $item ); |
|
90 | + $item = $manager->saveItem($item); |
|
91 | 91 | |
92 | 92 | $this->view->item = $item; |
93 | 93 | $result = $this->object->save(); |
94 | 94 | |
95 | - $manager->deleteItem( $item->getId() ); |
|
95 | + $manager->deleteItem($item->getId()); |
|
96 | 96 | |
97 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
98 | - $this->assertNull( $result ); |
|
97 | + $this->assertNull($this->view->get('errors')); |
|
98 | + $this->assertNull($result); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | |
102 | 102 | public function testSaveException() |
103 | 103 | { |
104 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Special\Standard::class ) |
|
105 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
106 | - ->setMethods( array( 'getSubClients' ) ) |
|
104 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Special\Standard::class) |
|
105 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
106 | + ->setMethods(array('getSubClients')) |
|
107 | 107 | ->getMock(); |
108 | 108 | |
109 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
110 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
109 | + $object->expects($this->once())->method('getSubClients') |
|
110 | + ->will($this->throwException(new \RuntimeException())); |
|
111 | 111 | |
112 | 112 | $this->view = \TestHelperJqadm::getView(); |
113 | - $this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem(); |
|
113 | + $this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem(); |
|
114 | 114 | |
115 | - $object->setView( $this->view ); |
|
115 | + $object->setView($this->view); |
|
116 | 116 | |
117 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
117 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
118 | 118 | $object->save(); |
119 | 119 | } |
120 | 120 | |
121 | 121 | |
122 | 122 | public function testSaveMShopException() |
123 | 123 | { |
124 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Special\Standard::class ) |
|
125 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
126 | - ->setMethods( array( 'getSubClients' ) ) |
|
124 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Special\Standard::class) |
|
125 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
126 | + ->setMethods(array('getSubClients')) |
|
127 | 127 | ->getMock(); |
128 | 128 | |
129 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
130 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
129 | + $object->expects($this->once())->method('getSubClients') |
|
130 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
131 | 131 | |
132 | 132 | $this->view = \TestHelperJqadm::getView(); |
133 | - $this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem(); |
|
133 | + $this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem(); |
|
134 | 134 | |
135 | - $object->setView( $this->view ); |
|
135 | + $object->setView($this->view); |
|
136 | 136 | |
137 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
137 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
138 | 138 | $object->save(); |
139 | 139 | } |
140 | 140 | |
141 | 141 | |
142 | 142 | public function testSearch() |
143 | 143 | { |
144 | - $this->assertNull( $this->object->search() ); |
|
144 | + $this->assertNull($this->object->search()); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | |
148 | 148 | public function testGetSubClient() |
149 | 149 | { |
150 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
151 | - $this->object->getSubClient( 'unknown' ); |
|
150 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
151 | + $this->object->getSubClient('unknown'); |
|
152 | 152 | } |
153 | 153 | } |
@@ -21,40 +21,40 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Product\Special\Price\Standard( $this->context ); |
|
25 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
26 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
27 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Product\Special\Price\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
37 | 37 | public function testCreate() |
38 | 38 | { |
39 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
39 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
40 | 40 | |
41 | 41 | $this->view->item = $manager->createItem(); |
42 | 42 | $result = $this->object->create(); |
43 | 43 | |
44 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
45 | - $this->assertContains( 'item-special-price', $result ); |
|
44 | + $this->assertNull($this->view->get('errors')); |
|
45 | + $this->assertContains('item-special-price', $result); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | |
49 | 49 | public function testCopy() |
50 | 50 | { |
51 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
51 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
52 | 52 | |
53 | - $this->view->item = $manager->findItem( 'U:TESTP' ); |
|
53 | + $this->view->item = $manager->findItem('U:TESTP'); |
|
54 | 54 | $result = $this->object->copy(); |
55 | 55 | |
56 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
57 | - $this->assertContains( 'item-special-price', $result ); |
|
56 | + $this->assertNull($this->view->get('errors')); |
|
57 | + $this->assertContains('item-special-price', $result); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | |
@@ -62,48 +62,48 @@ 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::create( $this->context, 'product' ); |
|
72 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
73 | 73 | |
74 | - $this->view->item = $manager->findItem( 'U:TESTP' ); |
|
74 | + $this->view->item = $manager->findItem('U:TESTP'); |
|
75 | 75 | $result = $this->object->get(); |
76 | 76 | |
77 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
78 | - $this->assertContains( 'item-special-price', $result ); |
|
77 | + $this->assertNull($this->view->get('errors')); |
|
78 | + $this->assertContains('item-special-price', $result); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
82 | 82 | public function testSave() |
83 | 83 | { |
84 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
84 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
85 | 85 | $this->view->item = $manager->createItem(); |
86 | 86 | |
87 | 87 | $params = ['site' => 'unittest', 'specialprice' => ['custom' => '1']]; |
88 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params ); |
|
89 | - $this->view->addHelper( 'param', $helper ); |
|
88 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params); |
|
89 | + $this->view->addHelper('param', $helper); |
|
90 | 90 | |
91 | 91 | $this->object->save(); |
92 | 92 | |
93 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
94 | - $this->assertEquals( 1, count( $this->view->item->getListItems( 'attribute' ) ) ); |
|
93 | + $this->assertNull($this->view->get('errors')); |
|
94 | + $this->assertEquals(1, count($this->view->item->getListItems('attribute'))); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | |
98 | 98 | public function testSearch() |
99 | 99 | { |
100 | - $this->assertNull( $this->object->search() ); |
|
100 | + $this->assertNull($this->object->search()); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | |
104 | 104 | public function testGetSubClient() |
105 | 105 | { |
106 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
107 | - $this->object->getSubClient( 'unknown' ); |
|
106 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
107 | + $this->object->getSubClient('unknown'); |
|
108 | 108 | } |
109 | 109 | } |
@@ -21,41 +21,41 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Product\Bundle\Standard( $this->context ); |
|
25 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
26 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
27 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Product\Bundle\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
37 | 37 | public function testCreate() |
38 | 38 | { |
39 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
39 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
40 | 40 | |
41 | 41 | $this->view->item = $manager->createItem(); |
42 | 42 | $result = $this->object->create(); |
43 | 43 | |
44 | - $this->assertContains( 'item-bundle', $result ); |
|
45 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
44 | + $this->assertContains('item-bundle', $result); |
|
45 | + $this->assertNull($this->view->get('errors')); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | |
49 | 49 | public function testCopy() |
50 | 50 | { |
51 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
51 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
52 | 52 | |
53 | - $this->view->item = $manager->findItem( 'U:BUNDLE', array( 'product' ) ); |
|
53 | + $this->view->item = $manager->findItem('U:BUNDLE', array('product')); |
|
54 | 54 | $result = $this->object->copy(); |
55 | 55 | |
56 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
57 | - $this->assertContains( 'Cafe Noire Cappuccino', $result ); |
|
58 | - $this->assertContains( 'Cafe Noire Expresso', $result ); |
|
56 | + $this->assertNull($this->view->get('errors')); |
|
57 | + $this->assertContains('Cafe Noire Cappuccino', $result); |
|
58 | + $this->assertContains('Cafe Noire Expresso', $result); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | |
@@ -63,97 +63,97 @@ 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::create( $this->context, 'product' ); |
|
73 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
74 | 74 | |
75 | - $this->view->item = $manager->findItem( 'U:BUNDLE', array( 'product' ) ); |
|
75 | + $this->view->item = $manager->findItem('U:BUNDLE', array('product')); |
|
76 | 76 | $result = $this->object->get(); |
77 | 77 | |
78 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
79 | - $this->assertContains( 'Cafe Noire Cappuccino', $result ); |
|
80 | - $this->assertContains( 'Cafe Noire Expresso', $result ); |
|
78 | + $this->assertNull($this->view->get('errors')); |
|
79 | + $this->assertContains('Cafe Noire Cappuccino', $result); |
|
80 | + $this->assertContains('Cafe Noire Expresso', $result); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | |
84 | 84 | public function testSave() |
85 | 85 | { |
86 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
87 | - $this->view->item = $manager->findItem( 'U:BUNDLE' ); |
|
86 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
87 | + $this->view->item = $manager->findItem('U:BUNDLE'); |
|
88 | 88 | |
89 | 89 | $param = array( |
90 | 90 | 'site' => 'unittest', |
91 | 91 | 'bundle' => array( |
92 | - 'product.lists.id' => array( '' ), |
|
93 | - 'product.lists.refid' => array( $manager->findItem( 'CNE' )->getId() ), |
|
92 | + 'product.lists.id' => array(''), |
|
93 | + 'product.lists.refid' => array($manager->findItem('CNE')->getId()), |
|
94 | 94 | ), |
95 | 95 | ); |
96 | 96 | |
97 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
98 | - $this->view->addHelper( 'param', $helper ); |
|
97 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
98 | + $this->view->addHelper('param', $helper); |
|
99 | 99 | |
100 | 100 | $result = $this->object->save(); |
101 | 101 | |
102 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
103 | - $this->assertNull( $result ); |
|
104 | - $this->assertEquals( 1, count( $this->view->item->getListItems( 'product' ) ) ); |
|
102 | + $this->assertNull($this->view->get('errors')); |
|
103 | + $this->assertNull($result); |
|
104 | + $this->assertEquals(1, count($this->view->item->getListItems('product'))); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | |
108 | 108 | public function testSaveException() |
109 | 109 | { |
110 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Bundle\Standard::class ) |
|
111 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
112 | - ->setMethods( array( 'fromArray' ) ) |
|
110 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Bundle\Standard::class) |
|
111 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
112 | + ->setMethods(array('fromArray')) |
|
113 | 113 | ->getMock(); |
114 | 114 | |
115 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
116 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
115 | + $object->expects($this->once())->method('fromArray') |
|
116 | + ->will($this->throwException(new \RuntimeException())); |
|
117 | 117 | |
118 | 118 | $this->view = \TestHelperJqadm::getView(); |
119 | - $this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->findItem( 'U:BUNDLE' ); |
|
119 | + $this->view->item = \Aimeos\MShop::create($this->context, 'product')->findItem('U:BUNDLE'); |
|
120 | 120 | |
121 | - $object->setView( $this->view ); |
|
121 | + $object->setView($this->view); |
|
122 | 122 | |
123 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
123 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
124 | 124 | $object->save(); |
125 | 125 | } |
126 | 126 | |
127 | 127 | |
128 | 128 | public function testSaveMShopException() |
129 | 129 | { |
130 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Bundle\Standard::class ) |
|
131 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
132 | - ->setMethods( array( 'fromArray' ) ) |
|
130 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Bundle\Standard::class) |
|
131 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
132 | + ->setMethods(array('fromArray')) |
|
133 | 133 | ->getMock(); |
134 | 134 | |
135 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
136 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
135 | + $object->expects($this->once())->method('fromArray') |
|
136 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
137 | 137 | |
138 | 138 | $this->view = \TestHelperJqadm::getView(); |
139 | - $this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->findItem( 'U:BUNDLE' ); |
|
139 | + $this->view->item = \Aimeos\MShop::create($this->context, 'product')->findItem('U:BUNDLE'); |
|
140 | 140 | |
141 | - $object->setView( $this->view ); |
|
141 | + $object->setView($this->view); |
|
142 | 142 | |
143 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
143 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
144 | 144 | $object->save(); |
145 | 145 | } |
146 | 146 | |
147 | 147 | |
148 | 148 | public function testSearch() |
149 | 149 | { |
150 | - $this->assertNull( $this->object->search() ); |
|
150 | + $this->assertNull($this->object->search()); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | |
154 | 154 | public function testGetSubClient() |
155 | 155 | { |
156 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
157 | - $this->object->getSubClient( 'unknown' ); |
|
156 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
157 | + $this->object->getSubClient('unknown'); |
|
158 | 158 | } |
159 | 159 | } |
@@ -21,75 +21,75 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $langManager = \Aimeos\MShop::create( $this->context, 'locale/language' ); |
|
24 | + $langManager = \Aimeos\MShop::create($this->context, 'locale/language'); |
|
25 | 25 | |
26 | - $this->view->pageLanguages = $langManager->searchItems( $langManager->createSearch() ); |
|
27 | - $this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem(); |
|
26 | + $this->view->pageLanguages = $langManager->searchItems($langManager->createSearch()); |
|
27 | + $this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem(); |
|
28 | 28 | |
29 | - $this->object = new \Aimeos\Admin\JQAdm\Product\Text\Standard( $this->context ); |
|
30 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
31 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
32 | - $this->object->setView( $this->view ); |
|
29 | + $this->object = new \Aimeos\Admin\JQAdm\Product\Text\Standard($this->context); |
|
30 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
31 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
32 | + $this->object->setView($this->view); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
36 | 36 | protected function tearDown() |
37 | 37 | { |
38 | - unset( $this->object, $this->view, $this->context ); |
|
38 | + unset($this->object, $this->view, $this->context); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | |
42 | 42 | public function testCreate() |
43 | 43 | { |
44 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
44 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
45 | 45 | |
46 | 46 | $this->view->item = $manager->createItem(); |
47 | 47 | $result = $this->object->create(); |
48 | 48 | |
49 | - $this->assertContains( 'item-text', $result ); |
|
50 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
49 | + $this->assertContains('item-text', $result); |
|
50 | + $this->assertNull($this->view->get('errors')); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | |
54 | 54 | public function testCopy() |
55 | 55 | { |
56 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
56 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
57 | 57 | |
58 | - $this->view->item = $manager->findItem( 'ABCD', array( 'text' ) ); |
|
58 | + $this->view->item = $manager->findItem('ABCD', array('text')); |
|
59 | 59 | $result = $this->object->copy(); |
60 | 60 | |
61 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
62 | - $this->assertContains( '"text.label":"subproduct1"', $result ); |
|
61 | + $this->assertNull($this->view->get('errors')); |
|
62 | + $this->assertContains('"text.label":"subproduct1"', $result); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | |
66 | 66 | public function testDelete() |
67 | 67 | { |
68 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
68 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
69 | 69 | |
70 | 70 | $this->view->item = $manager->createItem(); |
71 | 71 | $result = $this->object->delete(); |
72 | 72 | |
73 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
74 | - $this->assertNull( $result ); |
|
73 | + $this->assertNull($this->view->get('errors')); |
|
74 | + $this->assertNull($result); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | |
78 | 78 | public function testGet() |
79 | 79 | { |
80 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
80 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
81 | 81 | |
82 | - $this->view->item = $manager->findItem( 'ABCD', array( 'text' ) ); |
|
82 | + $this->view->item = $manager->findItem('ABCD', array('text')); |
|
83 | 83 | $result = $this->object->get(); |
84 | 84 | |
85 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
86 | - $this->assertContains( '"text.label":"subproduct1"', $result ); |
|
85 | + $this->assertNull($this->view->get('errors')); |
|
86 | + $this->assertContains('"text.label":"subproduct1"', $result); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | |
90 | 90 | public function testSave() |
91 | 91 | { |
92 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
92 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
93 | 93 | $item = $manager->createItem(); |
94 | 94 | |
95 | 95 | $param = array( |
@@ -119,75 +119,75 @@ discard block |
||
119 | 119 | ), |
120 | 120 | ); |
121 | 121 | |
122 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
123 | - $this->view->addHelper( 'param', $helper ); |
|
122 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
123 | + $this->view->addHelper('param', $helper); |
|
124 | 124 | $this->view->item = $item; |
125 | 125 | |
126 | 126 | $result = $this->object->save(); |
127 | 127 | |
128 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
129 | - $this->assertNull( $result ); |
|
130 | - $this->assertEquals( 3, count( $item->getListItems() ) ); |
|
128 | + $this->assertNull($this->view->get('errors')); |
|
129 | + $this->assertNull($result); |
|
130 | + $this->assertEquals(3, count($item->getListItems())); |
|
131 | 131 | |
132 | - foreach( $item->getListItems( 'text' ) as $listItem ) |
|
132 | + foreach ($item->getListItems('text') as $listItem) |
|
133 | 133 | { |
134 | - $this->assertEquals( 'text', $listItem->getDomain() ); |
|
134 | + $this->assertEquals('text', $listItem->getDomain()); |
|
135 | 135 | |
136 | 136 | $refItem = $listItem->getRefItem(); |
137 | - $this->assertEquals( 'de', $refItem->getLanguageId() ); |
|
137 | + $this->assertEquals('de', $refItem->getLanguageId()); |
|
138 | 138 | } |
139 | 139 | } |
140 | 140 | |
141 | 141 | |
142 | 142 | public function testSaveException() |
143 | 143 | { |
144 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Text\Standard::class ) |
|
145 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
146 | - ->setMethods( array( 'fromArray' ) ) |
|
144 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Text\Standard::class) |
|
145 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
146 | + ->setMethods(array('fromArray')) |
|
147 | 147 | ->getMock(); |
148 | 148 | |
149 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
150 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
149 | + $object->expects($this->once())->method('fromArray') |
|
150 | + ->will($this->throwException(new \RuntimeException())); |
|
151 | 151 | |
152 | 152 | $this->view = \TestHelperJqadm::getView(); |
153 | - $this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem(); |
|
153 | + $this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem(); |
|
154 | 154 | |
155 | - $object->setView( $this->view ); |
|
155 | + $object->setView($this->view); |
|
156 | 156 | |
157 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
157 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
158 | 158 | $object->save(); |
159 | 159 | } |
160 | 160 | |
161 | 161 | |
162 | 162 | public function testSaveMShopException() |
163 | 163 | { |
164 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Text\Standard::class ) |
|
165 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
166 | - ->setMethods( array( 'fromArray' ) ) |
|
164 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Text\Standard::class) |
|
165 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
166 | + ->setMethods(array('fromArray')) |
|
167 | 167 | ->getMock(); |
168 | 168 | |
169 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
170 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
169 | + $object->expects($this->once())->method('fromArray') |
|
170 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
171 | 171 | |
172 | 172 | $this->view = \TestHelperJqadm::getView(); |
173 | - $this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem(); |
|
173 | + $this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem(); |
|
174 | 174 | |
175 | - $object->setView( $this->view ); |
|
175 | + $object->setView($this->view); |
|
176 | 176 | |
177 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
177 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
178 | 178 | $object->save(); |
179 | 179 | } |
180 | 180 | |
181 | 181 | |
182 | 182 | public function testSearch() |
183 | 183 | { |
184 | - $this->assertNull( $this->object->search() ); |
|
184 | + $this->assertNull($this->object->search()); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | |
188 | 188 | public function testGetSubClient() |
189 | 189 | { |
190 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
191 | - $this->object->getSubClient( 'unknown' ); |
|
190 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
191 | + $this->object->getSubClient('unknown'); |
|
192 | 192 | } |
193 | 193 | } |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Product\Selection\Standard( $this->context ); |
|
25 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
26 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
27 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Product\Selection\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
@@ -56,61 +56,61 @@ discard block |
||
56 | 56 | ), |
57 | 57 | ); |
58 | 58 | |
59 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
60 | - $this->view->addHelper( 'param', $helper ); |
|
59 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
60 | + $this->view->addHelper('param', $helper); |
|
61 | 61 | |
62 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
62 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
63 | 63 | |
64 | 64 | $this->view->item = $manager->createItem(); |
65 | 65 | $result = $this->object->create(); |
66 | 66 | |
67 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
68 | - $this->assertContains( 'item-selection', $result ); |
|
69 | - $this->assertContains( '"product.code":"testprod"', $result ); |
|
70 | - $this->assertContains( '"attribute.label":"test attribute"', $result ); |
|
67 | + $this->assertNull($this->view->get('errors')); |
|
68 | + $this->assertContains('item-selection', $result); |
|
69 | + $this->assertContains('"product.code":"testprod"', $result); |
|
70 | + $this->assertContains('"attribute.label":"test attribute"', $result); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | |
74 | 74 | public function testCopy() |
75 | 75 | { |
76 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
76 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
77 | 77 | |
78 | - $this->view->item = $manager->findItem( 'U:TEST', ['attribute', 'product'] ); |
|
78 | + $this->view->item = $manager->findItem('U:TEST', ['attribute', 'product']); |
|
79 | 79 | $result = $this->object->copy(); |
80 | 80 | |
81 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
82 | - $this->assertContains( '"product.code":"U:TESTSUB01"', $result ); |
|
83 | - $this->assertContains( '"product.code":"U:TESTSUB02"', $result ); |
|
84 | - $this->assertContains( '"product.code":"U:TESTSUB03"', $result ); |
|
85 | - $this->assertContains( '"product.code":"U:TESTSUB04"', $result ); |
|
86 | - $this->assertContains( '"product.code":"U:TESTSUB05"', $result ); |
|
87 | - $this->assertContains( '"attribute.label":"product\/length\/30"', $result ); |
|
88 | - $this->assertContains( '"attribute.label":"product\/length\/32"', $result ); |
|
81 | + $this->assertNull($this->view->get('errors')); |
|
82 | + $this->assertContains('"product.code":"U:TESTSUB01"', $result); |
|
83 | + $this->assertContains('"product.code":"U:TESTSUB02"', $result); |
|
84 | + $this->assertContains('"product.code":"U:TESTSUB03"', $result); |
|
85 | + $this->assertContains('"product.code":"U:TESTSUB04"', $result); |
|
86 | + $this->assertContains('"product.code":"U:TESTSUB05"', $result); |
|
87 | + $this->assertContains('"attribute.label":"product\/length\/30"', $result); |
|
88 | + $this->assertContains('"attribute.label":"product\/length\/32"', $result); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | |
92 | 92 | public function testGet() |
93 | 93 | { |
94 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
95 | - $this->view->item = $manager->findItem( 'U:TEST', ['attribute', 'product'] ); |
|
94 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
95 | + $this->view->item = $manager->findItem('U:TEST', ['attribute', 'product']); |
|
96 | 96 | |
97 | 97 | $result = $this->object->get(); |
98 | 98 | |
99 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
100 | - $this->assertContains( '"product.code":"U:TESTSUB01"', $result ); |
|
101 | - $this->assertContains( '"product.code":"U:TESTSUB02"', $result ); |
|
102 | - $this->assertContains( '"product.code":"U:TESTSUB03"', $result ); |
|
103 | - $this->assertContains( '"product.code":"U:TESTSUB04"', $result ); |
|
104 | - $this->assertContains( '"product.code":"U:TESTSUB05"', $result ); |
|
105 | - $this->assertContains( '"attribute.label":"product\/length\/30"', $result ); |
|
106 | - $this->assertContains( '"attribute.label":"product\/length\/32"', $result ); |
|
99 | + $this->assertNull($this->view->get('errors')); |
|
100 | + $this->assertContains('"product.code":"U:TESTSUB01"', $result); |
|
101 | + $this->assertContains('"product.code":"U:TESTSUB02"', $result); |
|
102 | + $this->assertContains('"product.code":"U:TESTSUB03"', $result); |
|
103 | + $this->assertContains('"product.code":"U:TESTSUB04"', $result); |
|
104 | + $this->assertContains('"product.code":"U:TESTSUB05"', $result); |
|
105 | + $this->assertContains('"attribute.label":"product\/length\/30"', $result); |
|
106 | + $this->assertContains('"attribute.label":"product\/length\/32"', $result); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | |
110 | 110 | public function testSave() |
111 | 111 | { |
112 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
113 | - $this->view->item = $manager->findItem( 'U:TEST' ); |
|
112 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
113 | + $this->view->item = $manager->findItem('U:TEST'); |
|
114 | 114 | |
115 | 115 | $param = array( |
116 | 116 | 'site' => 'unittest', |
@@ -132,75 +132,75 @@ discard block |
||
132 | 132 | ), |
133 | 133 | ); |
134 | 134 | |
135 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
136 | - $this->view->addHelper( 'param', $helper ); |
|
135 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
136 | + $this->view->addHelper('param', $helper); |
|
137 | 137 | |
138 | 138 | $result = $this->object->save(); |
139 | 139 | |
140 | 140 | |
141 | - $this->assertNull( $this->view->get( 'errors' ) ); |
|
142 | - $this->assertNull( $result ); |
|
141 | + $this->assertNull($this->view->get('errors')); |
|
142 | + $this->assertNull($result); |
|
143 | 143 | |
144 | - $variants = $this->view->item->getListItems( 'product' ); |
|
145 | - $this->assertEquals( 1, count( $variants ) ); |
|
144 | + $variants = $this->view->item->getListItems('product'); |
|
145 | + $this->assertEquals(1, count($variants)); |
|
146 | 146 | |
147 | - $refItem = reset( $variants )->getRefItem(); |
|
148 | - $this->assertEquals( '123', reset( $variants )->getRefId() ); |
|
149 | - $this->assertEquals( '123', $refItem->getId() ); |
|
150 | - $this->assertEquals( 'testprod', $refItem->getCode() ); |
|
151 | - $this->assertEquals( 'test product', $refItem->getLabel() ); |
|
152 | - $this->assertEquals( 1, $refItem->getStatus() ); |
|
147 | + $refItem = reset($variants)->getRefItem(); |
|
148 | + $this->assertEquals('123', reset($variants)->getRefId()); |
|
149 | + $this->assertEquals('123', $refItem->getId()); |
|
150 | + $this->assertEquals('testprod', $refItem->getCode()); |
|
151 | + $this->assertEquals('test product', $refItem->getLabel()); |
|
152 | + $this->assertEquals(1, $refItem->getStatus()); |
|
153 | 153 | |
154 | - $attributes = $refItem->getListItems( 'attribute' ); |
|
155 | - $this->assertEquals( 1, count( $attributes ) ); |
|
156 | - $this->assertEquals( '456', reset( $attributes )->getId() ); |
|
157 | - $this->assertEquals( '789', reset( $attributes )->getRefId() ); |
|
154 | + $attributes = $refItem->getListItems('attribute'); |
|
155 | + $this->assertEquals(1, count($attributes)); |
|
156 | + $this->assertEquals('456', reset($attributes)->getId()); |
|
157 | + $this->assertEquals('789', reset($attributes)->getRefId()); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | |
161 | 161 | public function testSaveException() |
162 | 162 | { |
163 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Selection\Standard::class ) |
|
164 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
165 | - ->setMethods( array( 'fromArray' ) ) |
|
163 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Selection\Standard::class) |
|
164 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
165 | + ->setMethods(array('fromArray')) |
|
166 | 166 | ->getMock(); |
167 | 167 | |
168 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
169 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
168 | + $object->expects($this->once())->method('fromArray') |
|
169 | + ->will($this->throwException(new \RuntimeException())); |
|
170 | 170 | |
171 | 171 | $this->view = \TestHelperJqadm::getView(); |
172 | - $this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->findItem( 'U:TEST' ); |
|
172 | + $this->view->item = \Aimeos\MShop::create($this->context, 'product')->findItem('U:TEST'); |
|
173 | 173 | |
174 | - $object->setView( $this->view ); |
|
174 | + $object->setView($this->view); |
|
175 | 175 | |
176 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
176 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
177 | 177 | $object->save(); |
178 | 178 | } |
179 | 179 | |
180 | 180 | |
181 | 181 | public function testSaveMShopException() |
182 | 182 | { |
183 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Selection\Standard::class ) |
|
184 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
185 | - ->setMethods( array( 'fromArray' ) ) |
|
183 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Selection\Standard::class) |
|
184 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
185 | + ->setMethods(array('fromArray')) |
|
186 | 186 | ->getMock(); |
187 | 187 | |
188 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
189 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
188 | + $object->expects($this->once())->method('fromArray') |
|
189 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
190 | 190 | |
191 | 191 | $this->view = \TestHelperJqadm::getView(); |
192 | - $this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->findItem( 'U:TEST' ); |
|
192 | + $this->view->item = \Aimeos\MShop::create($this->context, 'product')->findItem('U:TEST'); |
|
193 | 193 | |
194 | - $object->setView( $this->view ); |
|
194 | + $object->setView($this->view); |
|
195 | 195 | |
196 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
196 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
197 | 197 | $object->save(); |
198 | 198 | } |
199 | 199 | |
200 | 200 | |
201 | 201 | public function testGetSubClient() |
202 | 202 | { |
203 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
204 | - $this->object->getSubClient( 'unknown' ); |
|
203 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
204 | + $this->object->getSubClient('unknown'); |
|
205 | 205 | } |
206 | 206 | } |