Completed
Push — master ( 521882...b49ab8 )
by Aimeos
04:07
created
admin/jqadm/tests/Admin/JQAdm/Product/Special/StandardTest.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -21,40 +21,40 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/Special/Price/StandardTest.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -21,40 +21,40 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/Bundle/StandardTest.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -21,41 +21,41 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/Text/StandardTest.php 1 patch
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -21,75 +21,75 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/Selection/StandardTest.php 1 patch
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -21,16 +21,16 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/Download/StandardTest.php 1 patch
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -19,91 +19,91 @@  discard block
 block discarded – undo
19 19
 	protected function setUp()
20 20
 	{
21 21
 		$this->view = \TestHelperJqadm::getView();
22
-		$request = $this->getMockBuilder( \Psr\Http\Message\ServerRequestInterface::class )->getMock();
23
-		$helper = new \Aimeos\MW\View\Helper\Request\Standard( $this->view, $request, '127.0.0.1', 'test' );
24
-		$this->view ->addHelper( 'request', $helper );
22
+		$request = $this->getMockBuilder(\Psr\Http\Message\ServerRequestInterface::class)->getMock();
23
+		$helper = new \Aimeos\MW\View\Helper\Request\Standard($this->view, $request, '127.0.0.1', 'test');
24
+		$this->view ->addHelper('request', $helper);
25 25
 
26 26
 		$this->context = \TestHelperJqadm::getContext();
27 27
 
28
-		$this->object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Download\Standard::class )
29
-			->setConstructorArgs( array( $this->context ) )
30
-			->setMethods( array( 'storeFile' ) )
28
+		$this->object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Download\Standard::class)
29
+			->setConstructorArgs(array($this->context))
30
+			->setMethods(array('storeFile'))
31 31
 			->getMock();
32 32
 
33
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
34
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
35
-		$this->object->setView( $this->view );
33
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
34
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
35
+		$this->object->setView($this->view);
36 36
 	}
37 37
 
38 38
 
39 39
 	protected function tearDown()
40 40
 	{
41
-		unset( $this->object, $this->view, $this->context );
41
+		unset($this->object, $this->view, $this->context);
42 42
 	}
43 43
 
44 44
 
45 45
 	public function testCreate()
46 46
 	{
47
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
47
+		$manager = \Aimeos\MShop::create($this->context, 'product');
48 48
 
49 49
 		$this->view->item = $manager->createItem();
50 50
 		$result = $this->object->create();
51 51
 
52
-		$this->assertContains( 'item-download', $result );
53
-		$this->assertNull( $this->view->get( 'errors' ) );
52
+		$this->assertContains('item-download', $result);
53
+		$this->assertNull($this->view->get('errors'));
54 54
 	}
55 55
 
56 56
 
57 57
 	public function testCopy()
58 58
 	{
59
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
59
+		$manager = \Aimeos\MShop::create($this->context, 'product');
60 60
 
61
-		$this->view->item = $manager->findItem( 'CNE', array( 'attribute' ) );
61
+		$this->view->item = $manager->findItem('CNE', array('attribute'));
62 62
 		$result = $this->object->copy();
63 63
 
64
-		$this->assertNull( $this->view->get( 'errors' ) );
65
-		$this->assertContains( 'product/download/testurl', $result );
64
+		$this->assertNull($this->view->get('errors'));
65
+		$this->assertContains('product/download/testurl', $result);
66 66
 	}
67 67
 
68 68
 
69 69
 	public function testDelete()
70 70
 	{
71
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
71
+		$manager = \Aimeos\MShop::create($this->context, 'product');
72 72
 
73
-		$this->view->item = $manager->findItem( 'ABCD' );
73
+		$this->view->item = $manager->findItem('ABCD');
74 74
 		$result = $this->object->delete();
75 75
 
76
-		$this->assertNull( $this->view->get( 'errors' ) );
77
-		$this->assertNull( $result );
76
+		$this->assertNull($this->view->get('errors'));
77
+		$this->assertNull($result);
78 78
 	}
79 79
 
80 80
 
81 81
 	public function testGet()
82 82
 	{
83
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
83
+		$manager = \Aimeos\MShop::create($this->context, 'product');
84 84
 
85
-		$this->view->item = $manager->findItem( 'CNE', array( 'attribute' ) );
85
+		$this->view->item = $manager->findItem('CNE', array('attribute'));
86 86
 		$result = $this->object->get();
87 87
 
88
-		$this->assertNull( $this->view->get( 'errors' ) );
89
-		$this->assertContains( 'product/download/testurl', $result );
88
+		$this->assertNull($this->view->get('errors'));
89
+		$this->assertContains('product/download/testurl', $result);
90 90
 	}
91 91
 
92 92
 
93 93
 	public function testSave()
94 94
 	{
95
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
95
+		$manager = \Aimeos\MShop::create($this->context, 'product');
96 96
 		$this->view->item = $manager->createItem();
97 97
 
98
-		$file = $this->getMockBuilder( \Psr\Http\Message\UploadedFileInterface::class )->getMock();
99
-		$file->expects( $this->any() )->method( 'getError' )->will( $this->returnValue( UPLOAD_ERR_OK ) );
98
+		$file = $this->getMockBuilder(\Psr\Http\Message\UploadedFileInterface::class)->getMock();
99
+		$file->expects($this->any())->method('getError')->will($this->returnValue(UPLOAD_ERR_OK));
100 100
 
101
-		$request = $this->getMockBuilder( \Psr\Http\Message\ServerRequestInterface::class )->getMock();
102
-		$request->expects( $this->any() )->method( 'getUploadedFiles' )
103
-			->will( $this->returnValue( array( 'download' => array( 'file' => $file ) ) ) );
101
+		$request = $this->getMockBuilder(\Psr\Http\Message\ServerRequestInterface::class)->getMock();
102
+		$request->expects($this->any())->method('getUploadedFiles')
103
+			->will($this->returnValue(array('download' => array('file' => $file))));
104 104
 
105
-		$this->object->expects( $this->once() )->method( 'storeFile' )
106
-			->will( $this->returnValue( 'test/file.ext' ) );
105
+		$this->object->expects($this->once())->method('storeFile')
106
+			->will($this->returnValue('test/file.ext'));
107 107
 
108 108
 
109 109
 		$param = array(
@@ -114,73 +114,73 @@  discard block
 block discarded – undo
114 114
 			),
115 115
 		);
116 116
 
117
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
118
-		$this->view->addHelper( 'param', $helper );
117
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
118
+		$this->view->addHelper('param', $helper);
119 119
 
120
-		$helper = new \Aimeos\MW\View\Helper\Request\Standard( $this->view, $request );
121
-		$this->view->addHelper( 'request', $helper );
120
+		$helper = new \Aimeos\MW\View\Helper\Request\Standard($this->view, $request);
121
+		$this->view->addHelper('request', $helper);
122 122
 
123 123
 		$result = $this->object->save();
124 124
 
125
-		$listItems = $this->view->item->getListItems( 'attribute' );
125
+		$listItems = $this->view->item->getListItems('attribute');
126 126
 
127
-		$this->assertNull( $this->view->get( 'errors' ) );
128
-		$this->assertNull( $result );
129
-		$this->assertEquals( 1, count( $listItems ) );
130
-		$this->assertEquals( 'test', reset( $listItems )->getRefItem()->getLabel() );
131
-		$this->assertEquals( 'test/file.ext', reset( $listItems )->getRefItem()->getCode() );
127
+		$this->assertNull($this->view->get('errors'));
128
+		$this->assertNull($result);
129
+		$this->assertEquals(1, count($listItems));
130
+		$this->assertEquals('test', reset($listItems)->getRefItem()->getLabel());
131
+		$this->assertEquals('test/file.ext', reset($listItems)->getRefItem()->getCode());
132 132
 	}
133 133
 
134 134
 
135 135
 	public function testSaveException()
136 136
 	{
137
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Download\Standard::class )
138
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
139
-			->setMethods( array( 'fromArray' ) )
137
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Download\Standard::class)
138
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
139
+			->setMethods(array('fromArray'))
140 140
 			->getMock();
141 141
 
142
-		$object->expects( $this->once() )->method( 'fromArray' )
143
-			->will( $this->throwException( new \RuntimeException() ) );
142
+		$object->expects($this->once())->method('fromArray')
143
+			->will($this->throwException(new \RuntimeException()));
144 144
 
145 145
 		$this->view = \TestHelperJqadm::getView();
146
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem();
146
+		$this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem();
147 147
 
148
-		$object->setView( $this->view );
148
+		$object->setView($this->view);
149 149
 
150
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
150
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
151 151
 		$object->save();
152 152
 	}
153 153
 
154 154
 
155 155
 	public function testSaveMShopException()
156 156
 	{
157
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Download\Standard::class )
158
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
159
-			->setMethods( array( 'fromArray' ) )
157
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Download\Standard::class)
158
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
159
+			->setMethods(array('fromArray'))
160 160
 			->getMock();
161 161
 
162
-		$object->expects( $this->once() )->method( 'fromArray' )
163
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
162
+		$object->expects($this->once())->method('fromArray')
163
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
164 164
 
165 165
 		$this->view = \TestHelperJqadm::getView();
166
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem();
166
+		$this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem();
167 167
 
168
-		$object->setView( $this->view );
168
+		$object->setView($this->view);
169 169
 
170
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
170
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
171 171
 		$object->save();
172 172
 	}
173 173
 
174 174
 
175 175
 	public function testSearch()
176 176
 	{
177
-		$this->assertNull( $this->object->search() );
177
+		$this->assertNull($this->object->search());
178 178
 	}
179 179
 
180 180
 
181 181
 	public function testGetSubClient()
182 182
 	{
183
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
184
-		$this->object->getSubClient( 'unknown' );
183
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
184
+		$this->object->getSubClient('unknown');
185 185
 	}
186 186
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/Physical/StandardTest.php 1 patch
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -21,64 +21,64 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$this->object = new \Aimeos\Admin\JQAdm\Product\Physical\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\Physical\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-physical', $result );
45
-		$this->assertNull( $this->view->get( 'errors' ) );
44
+		$this->assertContains('item-physical', $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', ['product/property'] );
53
+		$this->view->item = $manager->findItem('CNC', ['product/property']);
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( 'value="20.0"', $result );
58
-		$this->assertContains( 'value="15.0"', $result );
59
-		$this->assertContains( 'value="10.0"', $result );
60
-		$this->assertContains( 'value="1.25"', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('value="20.0"', $result);
58
+		$this->assertContains('value="15.0"', $result);
59
+		$this->assertContains('value="10.0"', $result);
60
+		$this->assertContains('value="1.25"', $result);
61 61
 	}
62 62
 
63 63
 
64 64
 	public function testGet()
65 65
 	{
66
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
66
+		$manager = \Aimeos\MShop::create($this->context, 'product');
67 67
 
68
-		$this->view->item = $manager->findItem( 'CNC', ['product/property'] );
68
+		$this->view->item = $manager->findItem('CNC', ['product/property']);
69 69
 		$result = $this->object->get();
70 70
 
71
-		$this->assertNull( $this->view->get( 'errors' ) );
72
-		$this->assertContains( 'value="20.0"', $result );
73
-		$this->assertContains( 'value="15.0"', $result );
74
-		$this->assertContains( 'value="10.0"', $result );
75
-		$this->assertContains( 'value="1.25"', $result );
71
+		$this->assertNull($this->view->get('errors'));
72
+		$this->assertContains('value="20.0"', $result);
73
+		$this->assertContains('value="15.0"', $result);
74
+		$this->assertContains('value="10.0"', $result);
75
+		$this->assertContains('value="1.25"', $result);
76 76
 	}
77 77
 
78 78
 
79 79
 	public function testSave()
80 80
 	{
81
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
81
+		$manager = \Aimeos\MShop::create($this->context, 'product');
82 82
 		$this->view->item = $manager->createItem();
83 83
 
84 84
 		$param = array(
@@ -89,60 +89,60 @@  discard block
 block discarded – undo
89 89
 			),
90 90
 		);
91 91
 
92
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
93
-		$this->view->addHelper( 'param', $helper );
92
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
93
+		$this->view->addHelper('param', $helper);
94 94
 
95 95
 		$result = $this->object->save();
96 96
 
97
-		$this->assertNull( $this->view->get( 'errors' ) );
98
-		$this->assertNull( $result );
99
-		$this->assertEquals( 2, count( $this->view->item->getPropertyItems() ) );
97
+		$this->assertNull($this->view->get('errors'));
98
+		$this->assertNull($result);
99
+		$this->assertEquals(2, count($this->view->item->getPropertyItems()));
100 100
 	}
101 101
 
102 102
 
103 103
 	public function testSaveException()
104 104
 	{
105
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Physical\Standard::class )
106
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
107
-			->setMethods( array( 'fromArray' ) )
105
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Physical\Standard::class)
106
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
107
+			->setMethods(array('fromArray'))
108 108
 			->getMock();
109 109
 
110
-		$object->expects( $this->once() )->method( 'fromArray' )
111
-			->will( $this->throwException( new \RuntimeException() ) );
110
+		$object->expects($this->once())->method('fromArray')
111
+			->will($this->throwException(new \RuntimeException()));
112 112
 
113 113
 		$this->view = \TestHelperJqadm::getView();
114
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem();
114
+		$this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem();
115 115
 
116
-		$object->setView( $this->view );
116
+		$object->setView($this->view);
117 117
 
118
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
118
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
119 119
 		$object->save();
120 120
 	}
121 121
 
122 122
 
123 123
 	public function testSaveMShopException()
124 124
 	{
125
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Physical\Standard::class )
126
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
127
-			->setMethods( array( 'fromArray' ) )
125
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Physical\Standard::class)
126
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
127
+			->setMethods(array('fromArray'))
128 128
 			->getMock();
129 129
 
130
-		$object->expects( $this->once() )->method( 'fromArray' )
131
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
130
+		$object->expects($this->once())->method('fromArray')
131
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
132 132
 
133 133
 		$this->view = \TestHelperJqadm::getView();
134
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem();
134
+		$this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem();
135 135
 
136
-		$object->setView( $this->view );
136
+		$object->setView($this->view);
137 137
 
138
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
138
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
139 139
 		$object->save();
140 140
 	}
141 141
 
142 142
 
143 143
 	public function testGetSubClient()
144 144
 	{
145
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
146
-		$this->object->getSubClient( 'unknown' );
145
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
146
+		$this->object->getSubClient('unknown');
147 147
 	}
148 148
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/Price/StandardTest.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -21,70 +21,70 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$this->object = new \Aimeos\Admin\JQAdm\Product\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\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->assertContains( 'item-price', $result );
45
-		$this->assertNull( $this->view->get( 'errors' ) );
44
+		$this->assertContains('item-price', $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', array( 'price' ) );
53
+		$this->view->item = $manager->findItem('CNC', array('price'));
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( '"price.type":"default"', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('"price.type":"default"', $result);
58 58
 	}
59 59
 
60 60
 
61 61
 	public function testDelete()
62 62
 	{
63
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
63
+		$manager = \Aimeos\MShop::create($this->context, 'product');
64 64
 
65 65
 		$this->view->item = $manager->createItem();
66 66
 		$result = $this->object->delete();
67 67
 
68
-		$this->assertNull( $this->view->get( 'errors' ) );
69
-		$this->assertNull( $result );
68
+		$this->assertNull($this->view->get('errors'));
69
+		$this->assertNull($result);
70 70
 	}
71 71
 
72 72
 
73 73
 	public function testGet()
74 74
 	{
75
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
75
+		$manager = \Aimeos\MShop::create($this->context, 'product');
76 76
 
77
-		$this->view->item = $manager->findItem( 'CNC', array( 'price' ) );
77
+		$this->view->item = $manager->findItem('CNC', array('price'));
78 78
 		$result = $this->object->get();
79 79
 
80
-		$this->assertNull( $this->view->get( 'errors' ) );
81
-		$this->assertContains( '"price.type":"default"', $result );
80
+		$this->assertNull($this->view->get('errors'));
81
+		$this->assertContains('"price.type":"default"', $result);
82 82
 	}
83 83
 
84 84
 
85 85
 	public function testSave()
86 86
 	{
87
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
87
+		$manager = \Aimeos\MShop::create($this->context, 'product');
88 88
 		$item = $manager->createItem();
89 89
 
90 90
 		$param = array(
@@ -102,80 +102,80 @@  discard block
 block discarded – undo
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
-		$this->assertNull( $this->view->get( 'errors' ) );
112
-		$this->assertNull( $result );
113
-		$this->assertEquals( 1, count( $item->getListItems() ) );
111
+		$this->assertNull($this->view->get('errors'));
112
+		$this->assertNull($result);
113
+		$this->assertEquals(1, count($item->getListItems()));
114 114
 
115
-		foreach( $item->getListItems( 'price' ) as $listItem )
115
+		foreach ($item->getListItems('price') as $listItem)
116 116
 		{
117
-			$this->assertEquals( 'price', $listItem->getDomain() );
117
+			$this->assertEquals('price', $listItem->getDomain());
118 118
 
119 119
 			$refItem = $listItem->getRefItem();
120
-			$this->assertEquals( 'EUR', $refItem->getCurrencyId() );
121
-			$this->assertEquals( '2', $refItem->getQuantity() );
122
-			$this->assertEquals( '10.00', $refItem->getValue() );
123
-			$this->assertEquals( '1.00', $refItem->getCosts() );
124
-			$this->assertEquals( '5.00', $refItem->getRebate() );
125
-			$this->assertEquals( '20.00', $refItem->getTaxRate() );
120
+			$this->assertEquals('EUR', $refItem->getCurrencyId());
121
+			$this->assertEquals('2', $refItem->getQuantity());
122
+			$this->assertEquals('10.00', $refItem->getValue());
123
+			$this->assertEquals('1.00', $refItem->getCosts());
124
+			$this->assertEquals('5.00', $refItem->getRebate());
125
+			$this->assertEquals('20.00', $refItem->getTaxRate());
126 126
 		}
127 127
 	}
128 128
 
129 129
 
130 130
 	public function testSaveException()
131 131
 	{
132
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Price\Standard::class )
133
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
134
-			->setMethods( array( 'fromArray' ) )
132
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Price\Standard::class)
133
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
134
+			->setMethods(array('fromArray'))
135 135
 			->getMock();
136 136
 
137
-		$object->expects( $this->once() )->method( 'fromArray' )
138
-			->will( $this->throwException( new \RuntimeException() ) );
137
+		$object->expects($this->once())->method('fromArray')
138
+			->will($this->throwException(new \RuntimeException()));
139 139
 
140 140
 		$view = \TestHelperJqadm::getView();
141
-		$view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem();
141
+		$view->item = \Aimeos\MShop::create($this->context, 'product')->createItem();
142 142
 
143
-		$object->setView( $view );
143
+		$object->setView($view);
144 144
 
145
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
145
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
146 146
 		$object->save();
147 147
 	}
148 148
 
149 149
 
150 150
 	public function testSaveMShopException()
151 151
 	{
152
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Price\Standard::class )
153
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
154
-			->setMethods( array( 'fromArray' ) )
152
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Price\Standard::class)
153
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
154
+			->setMethods(array('fromArray'))
155 155
 			->getMock();
156 156
 
157
-		$object->expects( $this->once() )->method( 'fromArray' )
158
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
157
+		$object->expects($this->once())->method('fromArray')
158
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
159 159
 
160 160
 		$this->view = \TestHelperJqadm::getView();
161
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem();
161
+		$this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem();
162 162
 
163
-		$object->setView( $this->view );
163
+		$object->setView($this->view);
164 164
 
165
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
165
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
166 166
 		$object->save();
167 167
 	}
168 168
 
169 169
 
170 170
 	public function testSearch()
171 171
 	{
172
-		$this->assertNull( $this->object->search() );
172
+		$this->assertNull($this->object->search());
173 173
 	}
174 174
 
175 175
 
176 176
 	public function testGetSubClient()
177 177
 	{
178
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
179
-		$this->object->getSubClient( 'unknown' );
178
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
179
+		$this->object->getSubClient('unknown');
180 180
 	}
181 181
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Attribute/Property/StandardTest.php 1 patch
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -21,40 +21,40 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$this->object = new \Aimeos\Admin\JQAdm\Attribute\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\Attribute\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, 'attribute' );
39
+		$manager = \Aimeos\MShop::create($this->context, 'attribute');
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, 'attribute' );
51
+		$manager = \Aimeos\MShop::create($this->context, 'attribute');
52 52
 
53
-		$this->view->item = $manager->findItem( 'black', [], 'product', 'color' );
53
+		$this->view->item = $manager->findItem('black', [], 'product', 'color');
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
 block discarded – undo
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, 'attribute' );
72
+		$manager = \Aimeos\MShop::create($this->context, 'attribute');
73 73
 
74
-		$this->view->item = $manager->findItem( 'black', [], 'product', 'color' );
74
+		$this->view->item = $manager->findItem('black', [], 'product', 'color');
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, 'attribute' );
84
+		$manager = \Aimeos\MShop::create($this->context, 'attribute');
85 85
 		$this->view->item = $manager->createItem();
86 86
 
87 87
 		$param = array(
@@ -95,70 +95,70 @@  discard block
 block discarded – undo
95 95
 			),
96 96
 		);
97 97
 
98
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
99
-		$this->view->addHelper( 'param', $helper );
98
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
99
+		$this->view->addHelper('param', $helper);
100 100
 
101 101
 		$result = $this->object->save();
102 102
 
103
-		$items = $this->view->item->getPropertyItems( null, false );
103
+		$items = $this->view->item->getPropertyItems(null, false);
104 104
 
105
-		$this->assertNull( $this->view->get( 'errors' ) );
106
-		$this->assertNull( $result );
107
-		$this->assertEquals( 1, count( $items ) );
108
-		$this->assertEquals( null, reset( $items )->getLanguageId() );
109
-		$this->assertEquals( '#100000', reset( $items )->getValue() );
105
+		$this->assertNull($this->view->get('errors'));
106
+		$this->assertNull($result);
107
+		$this->assertEquals(1, count($items));
108
+		$this->assertEquals(null, reset($items)->getLanguageId());
109
+		$this->assertEquals('#100000', reset($items)->getValue());
110 110
 	}
111 111
 
112 112
 
113 113
 	public function testSaveException()
114 114
 	{
115
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Attribute\Property\Standard::class )
116
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
117
-			->setMethods( array( 'fromArray' ) )
115
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Attribute\Property\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, 'attribute' )->createItem();
124
+		$this->view->item = \Aimeos\MShop::create($this->context, 'attribute')->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\Attribute\Property\Standard::class )
136
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
137
-			->setMethods( array( 'fromArray' ) )
135
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Attribute\Property\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, 'attribute' )->createItem();
144
+		$this->view->item = \Aimeos\MShop::create($this->context, 'attribute')->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 testSearch()
154 154
 	{
155
-		$this->assertNull( $this->object->search() );
155
+		$this->assertNull($this->object->search());
156 156
 	}
157 157
 
158 158
 
159 159
 	public function testGetSubClient()
160 160
 	{
161
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
162
-		$this->object->getSubClient( 'unknown' );
161
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
162
+		$this->object->getSubClient('unknown');
163 163
 	}
164 164
 }
Please login to merge, or discard this patch.