Passed
Push — master ( f7bbd3...17cd43 )
by Aimeos
04:27
created
lib/mshoplib/tests/MShop/Price/Manager/Property/StandardTest.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
 		$search->setConditions( $search->compare( '==', 'price.property.editor', $this->editor ) );
55 55
 		$results = $this->object->searchItems( $search );
56 56
 
57
-		if( ( $item = reset($results) ) === false ) {
57
+		if( ( $item = reset( $results ) ) === false ) {
58 58
 			throw new \RuntimeException( 'No property item found' );
59 59
 		}
60 60
 
61
-		$item->setId(null);
61
+		$item->setId( null );
62 62
 		$item->setLanguageId( 'en' );
63 63
 		$resultSaved = $this->object->saveItem( $item );
64 64
 		$itemSaved = $this->object->getItem( $item->getId() );
@@ -109,13 +109,13 @@  discard block
 block discarded – undo
109 109
 	{
110 110
 		$search = $this->object->createSearch()->setSlice( 0, 1 );
111 111
 		$conditions = array(
112
-			$search->compare( '~=', 'price.property.value', '5.0'),
112
+			$search->compare( '~=', 'price.property.value', '5.0' ),
113 113
 			$search->compare( '==', 'price.property.editor', $this->editor )
114 114
 		);
115 115
 		$search->setConditions( $search->combine( '&&', $conditions ) );
116 116
 		$results = $this->object->searchItems( $search );
117 117
 
118
-		if( ($expected = reset($results)) === false ) {
118
+		if( ( $expected = reset( $results ) ) === false ) {
119 119
 			throw new \RuntimeException( sprintf( 'No price property item found for value "%1$s".', '1024' ) );
120 120
 		}
121 121
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 		$expr[] = $search->compare( '==', 'price.property.value', '5.0' );
155 155
 		$expr[] = $search->compare( '==', 'price.property.editor', $this->editor );
156 156
 
157
-		$search->setConditions( $search->combine('&&', $expr) );
157
+		$search->setConditions( $search->combine( '&&', $expr ) );
158 158
 		$results = $this->object->searchItems( $search, [], $total );
159 159
 		$this->assertEquals( 4, count( $results ) );
160 160
 	}
@@ -162,17 +162,17 @@  discard block
 block discarded – undo
162 162
 
163 163
 	public function testGetSubManager()
164 164
 	{
165
-		$this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager('type') );
166
-		$this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager('type', 'Standard') );
165
+		$this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager( 'type' ) );
166
+		$this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->getSubManager( 'type', 'Standard' ) );
167 167
 
168 168
 		$this->setExpectedException( \Aimeos\MShop\Exception::class );
169
-		$this->object->getSubManager('unknown');
169
+		$this->object->getSubManager( 'unknown' );
170 170
 	}
171 171
 
172 172
 
173 173
 	public function testGetSubManagerInvalidName()
174 174
 	{
175 175
 		$this->setExpectedException( \Aimeos\MShop\Exception::class );
176
-		$this->object->getSubManager('type', 'unknown');
176
+		$this->object->getSubManager( 'type', 'unknown' );
177 177
 	}
178 178
 }
Please login to merge, or discard this patch.
lib/mshoplib/tests/MShop/Price/Manager/Property/Type/StandardTest.php 1 patch
Spacing   +8 added lines, -8 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\Price\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( '==', 'price.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( '>=', 'price.property.type.ctime', '1970-01-01 00:00:00' );
158 158
 		$expr[] = $search->compare( '==', 'price.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
 
163 163
 		$this->assertEquals( 1, count( $results ) );
@@ -167,6 +167,6 @@  discard block
 block discarded – undo
167 167
 	public function testGetSubManager()
168 168
 	{
169 169
 		$this->setExpectedException( \Aimeos\MShop\Exception::class );
170
-		$this->object->getSubManager('unknown');
170
+		$this->object->getSubManager( 'unknown' );
171 171
 	}
172 172
 }
Please login to merge, or discard this patch.
lib/mshoplib/setup/default/schema/price.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 return array(
10 10
 	'table' => array(
11
-		'mshop_price_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
11
+		'mshop_price_type' => function( \Doctrine\DBAL\Schema\Schema $schema ) {
12 12
 
13 13
 			$table = $schema->createTable( 'mshop_price_type' );
14 14
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 			return $schema;
33 33
 		},
34 34
 
35
-		'mshop_price' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
35
+		'mshop_price' => function( \Doctrine\DBAL\Schema\Schema $schema ) {
36 36
 
37 37
 			$table = $schema->createTable( 'mshop_price' );
38 38
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 			$table->addColumn( 'status', 'smallint', [] );
51 51
 			$table->addColumn( 'mtime', 'datetime', [] );
52 52
 			$table->addColumn( 'ctime', 'datetime', [] );
53
-			$table->addColumn( 'editor', 'string', array('length' => 255 ) );
53
+			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
54 54
 
55 55
 			$table->setPrimaryKey( array( 'id' ), 'pk_mspri_id' );
56 56
 			$table->addIndex( array( 'siteid', 'domain', 'currencyid' ), 'idx_mspri_sid_dom_currid' );
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 			return $schema;
64 64
 		},
65 65
 
66
-		'mshop_price_list_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
66
+		'mshop_price_list_type' => function( \Doctrine\DBAL\Schema\Schema $schema ) {
67 67
 
68 68
 			$table = $schema->createTable( 'mshop_price_list_type' );
69 69
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 			return $schema;
88 88
 		},
89 89
 
90
-		'mshop_price_list' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
90
+		'mshop_price_list' => function( \Doctrine\DBAL\Schema\Schema $schema ) {
91 91
 
92 92
 			$table = $schema->createTable( 'mshop_price_list' );
93 93
 
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 			return $schema;
119 119
 		},
120 120
 
121
-		'mshop_price_property_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
121
+		'mshop_price_property_type' => function( \Doctrine\DBAL\Schema\Schema $schema ) {
122 122
 
123 123
 			$table = $schema->createTable( 'mshop_price_property_type' );
124 124
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 			return $schema;
143 143
 		},
144 144
 
145
-		'mshop_price_property' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
145
+		'mshop_price_property' => function( \Doctrine\DBAL\Schema\Schema $schema ) {
146 146
 
147 147
 			$table = $schema->createTable( 'mshop_price_property' );
148 148
 
Please login to merge, or discard this patch.