Passed
Push — master ( 47e37b...2360ce )
by Aimeos
05:11
created
lib/mshoplib/tests/MShop/Customer/Manager/Property/Type/StandardTest.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -19,13 +19,13 @@  discard block
 block discarded – undo
19 19
 	{
20 20
 		$this->editor = \TestHelperMShop::getContext()->getEditor();
21 21
 		$manager = \Aimeos\MShop\Customer\Manager\Factory::create( \TestHelperMShop::getContext() );
22
-		$this->object = $manager->getSubManager( 'property' )->getSubManager('type');
22
+		$this->object = $manager->getSubManager( 'property' )->getSubManager( 'type' );
23 23
 	}
24 24
 
25 25
 
26 26
 	protected function tearDown()
27 27
 	{
28
-		unset($this->object);
28
+		unset( $this->object );
29 29
 	}
30 30
 
31 31
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 
67 67
 		$results = $this->object->searchItems( $search );
68 68
 
69
-		if( ($expected = reset($results) ) === false )
69
+		if( ( $expected = reset( $results ) ) === false )
70 70
 		{
71 71
 			throw new \RuntimeException( 'No property type item found.' );
72 72
 		}
@@ -88,13 +88,13 @@  discard block
 block discarded – undo
88 88
 	{
89 89
 		$search = $this->object->createSearch();
90 90
 		$search->setConditions( $search->compare( '==', 'customer.property.type.editor', $this->editor ) );
91
-		$results = $this->object->searchItems($search);
91
+		$results = $this->object->searchItems( $search );
92 92
 
93
-		if( ( $item = reset($results) ) === false ) {
93
+		if( ( $item = reset( $results ) ) === false ) {
94 94
 			throw new \RuntimeException( 'No type item found' );
95 95
 		}
96 96
 
97
-		$item->setId(null);
97
+		$item->setId( null );
98 98
 		$item->setCode( 'unitTestSave' );
99 99
 		$resultSaved = $this->object->saveItem( $item );
100 100
 		$itemSaved = $this->object->getItem( $item->getId() );
@@ -155,20 +155,20 @@  discard block
 block discarded – undo
155 155
 		$expr[] = $search->compare( '>=', 'customer.property.type.ctime', '1970-01-01 00:00:00' );
156 156
 		$expr[] = $search->compare( '==', 'customer.property.type.editor', $this->editor );
157 157
 
158
-		$search->setConditions( $search->combine('&&', $expr) );
158
+		$search->setConditions( $search->combine( '&&', $expr ) );
159 159
 		$results = $this->object->searchItems( $search, [], $total );
160 160
 		$this->assertEquals( 1, count( $results ) );
161 161
 
162 162
 
163 163
 		$search = $this->object->createSearch();
164 164
 		$conditions = array(
165
-			$search->compare( '=~', 'customer.property.type.code', 'newsletter'),
165
+			$search->compare( '=~', 'customer.property.type.code', 'newsletter' ),
166 166
 			$search->compare( '==', 'customer.property.type.editor', $this->editor )
167 167
 		);
168
-		$search->setConditions( $search->combine('&&', $conditions ) );
168
+		$search->setConditions( $search->combine( '&&', $conditions ) );
169 169
 		$search->setSortations( [$search->sort( '-', 'customer.property.type.position' )] );
170
-		$search->setSlice(0, 1);
171
-		$items = $this->object->searchItems( $search, [], $total);
170
+		$search->setSlice( 0, 1 );
171
+		$items = $this->object->searchItems( $search, [], $total );
172 172
 
173 173
 		$this->assertEquals( 1, count( $items ) );
174 174
 		$this->assertEquals( 1, $total );
@@ -182,6 +182,6 @@  discard block
 block discarded – undo
182 182
 	public function testGetSubManager()
183 183
 	{
184 184
 		$this->setExpectedException( \Aimeos\MShop\Exception::class );
185
-		$this->object->getSubManager('unknown');
185
+		$this->object->getSubManager( 'unknown' );
186 186
 	}
187 187
 }
Please login to merge, or discard this patch.
lib/mshoplib/tests/MShop/Supplier/Manager/Lists/Type/StandardTest.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
 	public function testGetItem()
54 54
 	{
55 55
 		$search = $this->object->createSearch()->setSlice( 0, 1 );
56
-		$search->setConditions( $search->compare( '==', 'supplier.lists.type.editor', $this->editor) );
57
-		$results = $this->object->searchItems($search);
56
+		$search->setConditions( $search->compare( '==', 'supplier.lists.type.editor', $this->editor ) );
57
+		$results = $this->object->searchItems( $search );
58 58
 
59
-		if( ( $expected = reset($results) ) === false ) {
59
+		if( ( $expected = reset( $results ) ) === false ) {
60 60
 			throw new \RuntimeException( 'No attribute list type item found' );
61 61
 		}
62 62
 
@@ -74,14 +74,14 @@  discard block
 block discarded – undo
74 74
 	public function testSaveUpdateDeleteItem()
75 75
 	{
76 76
 		$search = $this->object->createSearch();
77
-		$search->setConditions( $search->compare( '==', 'supplier.lists.type.editor', $this->editor) );
78
-		$results = $this->object->searchItems($search);
77
+		$search->setConditions( $search->compare( '==', 'supplier.lists.type.editor', $this->editor ) );
78
+		$results = $this->object->searchItems( $search );
79 79
 
80
-		if( ( $item = reset($results) ) === false ) {
80
+		if( ( $item = reset( $results ) ) === false ) {
81 81
 			throw new \RuntimeException( 'No type item found' );
82 82
 		}
83 83
 
84
-		$item->setId(null);
84
+		$item->setId( null );
85 85
 		$item->setCode( 'unitTestSave' );
86 86
 		$resultSaved = $this->object->saveItem( $item );
87 87
 		$itemSaved = $this->object->getItem( $item->getId() );
@@ -141,9 +141,9 @@  discard block
 block discarded – undo
141 141
 		$expr[] = $search->compare( '>=', 'supplier.lists.type.ctime', '1970-01-01 00:00:00' );
142 142
 		$expr[] = $search->compare( '==', 'supplier.lists.type.editor', $this->editor );
143 143
 
144
-		$search->setConditions( $search->combine('&&', $expr) );
144
+		$search->setConditions( $search->combine( '&&', $expr ) );
145 145
 		$search->setSortations( [$search->sort( '-', 'supplier.lists.type.position' )] );
146
-		$search->setSlice(0, 1);
146
+		$search->setSlice( 0, 1 );
147 147
 		$results = $this->object->searchItems( $search, [], $total );
148 148
 		$this->assertEquals( 1, count( $results ) );
149 149
 		$this->assertEquals( 1, $total );
@@ -157,6 +157,6 @@  discard block
 block discarded – undo
157 157
 	public function testGetSubManager()
158 158
 	{
159 159
 		$this->setExpectedException( \Aimeos\MShop\Exception::class );
160
-		$this->object->getSubManager('unknown');
160
+		$this->object->getSubManager( 'unknown' );
161 161
 	}
162 162
 }
Please login to merge, or discard this patch.
lib/mshoplib/tests/MShop/Supplier/Manager/Lists/StandardTest.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 		$search->setConditions( $search->combine( '&&', $conditions ) );
82 82
 		$results = $this->object->searchItems( $search );
83 83
 
84
-		if( ( $item = reset($results) ) === false ) {
84
+		if( ( $item = reset( $results ) ) === false ) {
85 85
 			throw new \RuntimeException( 'No list item found' );
86 86
 		}
87 87
 
@@ -91,11 +91,11 @@  discard block
 block discarded – undo
91 91
 
92 92
 	public function testGetSubManager()
93 93
 	{
94
-		$this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager('type') );
95
-		$this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager('type', 'Standard') );
94
+		$this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager( 'type' ) );
95
+		$this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager( 'type', 'Standard' ) );
96 96
 
97 97
 		$this->setExpectedException( \Aimeos\MShop\Exception::class );
98
-		$this->object->getSubManager('unknown');
98
+		$this->object->getSubManager( 'unknown' );
99 99
 	}
100 100
 
101 101
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 			throw new \RuntimeException( 'No item found' );
123 123
 		}
124 124
 
125
-		$item->setId(null);
125
+		$item->setId( null );
126 126
 		$item->setDomain( 'unittest' );
127 127
 		$resultSaved = $this->object->saveItem( $item );
128 128
 		$itemSaved = $this->object->getItem( $item->getId() );
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 		$expr[] = $search->compare( '>=', 'supplier.lists.ctime', '1970-01-01 00:00:00' );
279 279
 		$expr[] = $search->compare( '==', 'supplier.lists.editor', $this->editor );
280 280
 
281
-		$search->setConditions( $search->combine('&&', $expr) );
281
+		$search->setConditions( $search->combine( '&&', $expr ) );
282 282
 		$results = $this->object->searchItems( $search, [], $total );
283 283
 		$this->assertEquals( 1, count( $results ) );
284 284
 	}
@@ -287,15 +287,15 @@  discard block
 block discarded – undo
287 287
 	public function testSearchItemsBase()
288 288
 	{
289 289
 		$total = 0;
290
-		$search = $this->object->createSearch(true);
290
+		$search = $this->object->createSearch( true );
291 291
 		$expr = array(
292 292
 			$search->compare( '==', 'supplier.lists.domain', 'text' ),
293 293
 			$search->compare( '==', 'supplier.lists.editor', $this->editor ),
294 294
 			$search->getConditions(),
295 295
 		);
296 296
 		$search->setConditions( $search->combine( '&&', $expr ) );
297
-		$search->setSlice(0, 1);
298
-		$results = $this->object->searchItems($search, [], $total);
297
+		$search->setSlice( 0, 1 );
298
+		$results = $this->object->searchItems( $search, [], $total );
299 299
 		$this->assertEquals( 1, count( $results ) );
300 300
 		$this->assertEquals( 3, $total );
301 301
 
Please login to merge, or discard this patch.
lib/mshoplib/tests/MShop/Product/Manager/Property/Type/StandardTest.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -19,13 +19,13 @@  discard block
 block discarded – undo
19 19
 	{
20 20
 		$this->editor = \TestHelperMShop::getContext()->getEditor();
21 21
 		$manager = \Aimeos\MShop\Product\Manager\Factory::create( \TestHelperMShop::getContext() );
22
-		$this->object = $manager->getSubManager( 'property' )->getSubManager('type');
22
+		$this->object = $manager->getSubManager( 'property' )->getSubManager( 'type' );
23 23
 	}
24 24
 
25 25
 
26 26
 	protected function tearDown()
27 27
 	{
28
-		unset($this->object);
28
+		unset( $this->object );
29 29
 	}
30 30
 
31 31
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 
69 69
 		$results = $this->object->searchItems( $search );
70 70
 
71
-		if( ($expected = reset($results) ) === false )
71
+		if( ( $expected = reset( $results ) ) === false )
72 72
 		{
73 73
 			throw new \RuntimeException( 'No property type item found.' );
74 74
 		}
@@ -90,13 +90,13 @@  discard block
 block discarded – undo
90 90
 	{
91 91
 		$search = $this->object->createSearch();
92 92
 		$search->setConditions( $search->compare( '==', 'product.property.type.editor', $this->editor ) );
93
-		$results = $this->object->searchItems($search);
93
+		$results = $this->object->searchItems( $search );
94 94
 
95
-		if( ( $item = reset($results) ) === false ) {
95
+		if( ( $item = reset( $results ) ) === false ) {
96 96
 			throw new \RuntimeException( 'No type item found' );
97 97
 		}
98 98
 
99
-		$item->setId(null);
99
+		$item->setId( null );
100 100
 		$item->setCode( 'unitTestSave' );
101 101
 		$resultSaved = $this->object->saveItem( $item );
102 102
 		$itemSaved = $this->object->getItem( $item->getId() );
@@ -157,20 +157,20 @@  discard block
 block discarded – undo
157 157
 		$expr[] = $search->compare( '>=', 'product.property.type.ctime', '1970-01-01 00:00:00' );
158 158
 		$expr[] = $search->compare( '==', 'product.property.type.editor', $this->editor );
159 159
 
160
-		$search->setConditions( $search->combine('&&', $expr) );
160
+		$search->setConditions( $search->combine( '&&', $expr ) );
161 161
 		$results = $this->object->searchItems( $search, [], $total );
162 162
 		$this->assertEquals( 1, count( $results ) );
163 163
 
164 164
 
165 165
 		$search = $this->object->createSearch();
166 166
 		$conditions = array(
167
-			$search->compare( '=~', 'product.property.type.code', 'package-'),
167
+			$search->compare( '=~', 'product.property.type.code', 'package-' ),
168 168
 			$search->compare( '==', 'product.property.type.editor', $this->editor )
169 169
 		);
170
-		$search->setConditions( $search->combine('&&', $conditions ) );
170
+		$search->setConditions( $search->combine( '&&', $conditions ) );
171 171
 		$search->setSortations( [$search->sort( '-', 'product.property.type.position' )] );
172
-		$search->setSlice(0, 1);
173
-		$items = $this->object->searchItems( $search, [], $total);
172
+		$search->setSlice( 0, 1 );
173
+		$items = $this->object->searchItems( $search, [], $total );
174 174
 
175 175
 		$this->assertEquals( 1, count( $items ) );
176 176
 		$this->assertEquals( 4, $total );
@@ -184,6 +184,6 @@  discard block
 block discarded – undo
184 184
 	public function testGetSubManager()
185 185
 	{
186 186
 		$this->setExpectedException( \Aimeos\MShop\Exception::class );
187
-		$this->object->getSubManager('unknown');
187
+		$this->object->getSubManager( 'unknown' );
188 188
 	}
189 189
 }
Please login to merge, or discard this patch.
lib/mshoplib/tests/MShop/Media/Manager/Property/Type/StandardTest.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -19,13 +19,13 @@  discard block
 block discarded – undo
19 19
 	{
20 20
 		$this->editor = \TestHelperMShop::getContext()->getEditor();
21 21
 		$manager = \Aimeos\MShop\Media\Manager\Factory::create( \TestHelperMShop::getContext() );
22
-		$this->object = $manager->getSubManager( 'property' )->getSubManager('type');
22
+		$this->object = $manager->getSubManager( 'property' )->getSubManager( 'type' );
23 23
 	}
24 24
 
25 25
 
26 26
 	protected function tearDown()
27 27
 	{
28
-		unset($this->object);
28
+		unset( $this->object );
29 29
 	}
30 30
 
31 31
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 
69 69
 		$results = $this->object->searchItems( $search );
70 70
 
71
-		if( ($expected = reset($results) ) === false )
71
+		if( ( $expected = reset( $results ) ) === false )
72 72
 		{
73 73
 			throw new \RuntimeException( 'No property type item found.' );
74 74
 		}
@@ -90,13 +90,13 @@  discard block
 block discarded – undo
90 90
 	{
91 91
 		$search = $this->object->createSearch();
92 92
 		$search->setConditions( $search->compare( '==', 'media.property.type.editor', $this->editor ) );
93
-		$results = $this->object->searchItems($search);
93
+		$results = $this->object->searchItems( $search );
94 94
 
95
-		if( ( $item = reset($results) ) === false ) {
95
+		if( ( $item = reset( $results ) ) === false ) {
96 96
 			throw new \RuntimeException( 'No type item found' );
97 97
 		}
98 98
 
99
-		$item->setId(null);
99
+		$item->setId( null );
100 100
 		$item->setCode( 'unitTestSave' );
101 101
 		$resultSaved = $this->object->saveItem( $item );
102 102
 		$itemSaved = $this->object->getItem( $item->getId() );
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 		$expr[] = $search->compare( '>=', 'media.property.type.ctime', '1970-01-01 00:00:00' );
158 158
 		$expr[] = $search->compare( '==', 'media.property.type.editor', $this->editor );
159 159
 
160
-		$search->setConditions( $search->combine('&&', $expr) );
160
+		$search->setConditions( $search->combine( '&&', $expr ) );
161 161
 		$results = $this->object->searchItems( $search, [], $total );
162 162
 		$this->assertEquals( 1, count( $results ) );
163 163
 
@@ -167,10 +167,10 @@  discard block
 block discarded – undo
167 167
 			$search->compare( '=~', 'media.property.type.code', '' ),
168 168
 			$search->compare( '==', 'media.property.type.editor', $this->editor )
169 169
 		);
170
-		$search->setConditions( $search->combine('&&', $conditions ) );
170
+		$search->setConditions( $search->combine( '&&', $conditions ) );
171 171
 		$search->setSortations( [$search->sort( '-', 'media.property.type.position' )] );
172
-		$search->setSlice(0, 1);
173
-		$items = $this->object->searchItems( $search, [], $total);
172
+		$search->setSlice( 0, 1 );
173
+		$items = $this->object->searchItems( $search, [], $total );
174 174
 
175 175
 		$this->assertEquals( 1, count( $items ) );
176 176
 		$this->assertEquals( 3, $total );
@@ -184,6 +184,6 @@  discard block
 block discarded – undo
184 184
 	public function testGetSubManager()
185 185
 	{
186 186
 		$this->setExpectedException( \Aimeos\MShop\Exception::class );
187
-		$this->object->getSubManager('unknown');
187
+		$this->object->getSubManager( 'unknown' );
188 188
 	}
189 189
 }
Please login to merge, or discard this patch.
lib/mshoplib/tests/MShop/Plugin/Provider/ExceptionTest.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,8 @@  discard block
 block discarded – undo
26 26
 
27 27
 	public function test()
28 28
 	{
29
-		try {
29
+		try
30
+		{
30 31
 			throw new \Aimeos\MShop\Plugin\Provider\Exception( 'msg', 13, null, $this->codes );
31 32
 		}
32 33
 		catch( \Aimeos\MShop\Plugin\Provider\Exception $mppe )
@@ -36,7 +37,8 @@  discard block
 block discarded – undo
36 37
 			$this->assertEquals( $this->codes, $mppe->getErrorCodes() );
37 38
 		}
38 39
 
39
-		try {
40
+		try
41
+		{
40 42
 			throw new \Aimeos\MShop\Plugin\Provider\Exception( 'msg2', 11 );
41 43
 		}
42 44
 		catch( \Aimeos\MShop\Plugin\Provider\Exception $e )
Please login to merge, or discard this patch.
lib/mshoplib/src/MShop/Common/Helper/Password/Hash.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,11 +55,11 @@
 block discarded – undo
55 55
 		$iterations = ( isset( $this->options['iterations'] ) ? (int) $this->options['iterations'] : 1 );
56 56
 
57 57
 		$salted = sprintf( $format, $password, $salt );
58
-		$digest = hash( $this->options['algorithm'], $salted, true);
58
+		$digest = hash( $this->options['algorithm'], $salted, true );
59 59
 
60 60
 		// "stretch" hash
61
-		for ( $i = 1; $i < $iterations; $i++ ) {
62
-			$digest = hash( $this->options['algorithm'], $digest . $salted, true);
61
+		for( $i = 1; $i < $iterations; $i++ ) {
62
+			$digest = hash( $this->options['algorithm'], $digest . $salted, true );
63 63
 		}
64 64
 
65 65
 		return ( $encode ? base64_encode( $digest ) : bin2hex( $digest ) );
Please login to merge, or discard this patch.
lib/mshoplib/src/MShop/Common/Manager/Base.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -400,8 +400,7 @@  discard block
 block discarded – undo
400 400
 			$e = new \Exception();
401 401
 			$msg['trace'] = $e->getTraceAsString();
402 402
 			$level = \Aimeos\MW\Logger\Base::NOTICE;
403
-		}
404
-		else
403
+		} else
405 404
 		{
406 405
 			$level = \Aimeos\MW\Logger\Base::DEBUG;
407 406
 		}
@@ -558,8 +557,7 @@  discard block
 block discarded – undo
558 557
 
559 558
 		if( isset( $attributes[$name] ) && $attributes[$name] instanceof $iface ) {
560 559
 			return $attributes[$name]->getInternalDeps();
561
-		}
562
-		else if( isset( $attributes['id'] ) && $attributes['id'] instanceof $iface ) {
560
+		} else if( isset( $attributes['id'] ) && $attributes['id'] instanceof $iface ) {
563 561
 			return $attributes['id']->getInternalDeps();
564 562
 		}
565 563
 
Please login to merge, or discard this patch.
lib/mshoplib/tests/MShop/Common/Item/Property/StandardTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 
67 67
 	public function testSetLanguageId()
68 68
 	{
69
-		$return = $this->object->setLanguageId('fr');
69
+		$return = $this->object->setLanguageId( 'fr' );
70 70
 
71 71
 		$this->assertInstanceOf( \Aimeos\MShop\Common\Item\Property\Iface::class, $return );
72 72
 		$this->assertEquals( 'fr', $this->object->getLanguageId() );
@@ -151,11 +151,11 @@  discard block
 block discarded – undo
151 151
 
152 152
 		$item = $item->fromArray( $entries, true );
153 153
 
154
-		$this->assertEquals([], $entries);
155
-		$this->assertEquals($list['common.property.parentid'], $item->getParentId());
156
-		$this->assertEquals($list['common.property.languageid'], $item->getLanguageId());
157
-		$this->assertEquals($list['common.property.value'], $item->getValue());
158
-		$this->assertEquals($list['common.property.type'], $item->getType());
154
+		$this->assertEquals( [], $entries );
155
+		$this->assertEquals( $list['common.property.parentid'], $item->getParentId() );
156
+		$this->assertEquals( $list['common.property.languageid'], $item->getLanguageId() );
157
+		$this->assertEquals( $list['common.property.value'], $item->getValue() );
158
+		$this->assertEquals( $list['common.property.type'], $item->getType() );
159 159
 		$this->assertNull( $item->getSiteId() );
160 160
 	}
161 161
 
Please login to merge, or discard this patch.