@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | protected function tearDown() |
| 29 | 29 | { |
| 30 | - unset($this->object); |
|
| 30 | + unset( $this->object ); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | $results = $this->object->searchItems( $search ); |
| 72 | 72 | |
| 73 | - if( ($expected = reset($results) ) === false ) |
|
| 73 | + if( ( $expected = reset( $results ) ) === false ) |
|
| 74 | 74 | { |
| 75 | 75 | throw new \RuntimeException( 'No property type item found.' ); |
| 76 | 76 | } |
@@ -92,13 +92,13 @@ discard block |
||
| 92 | 92 | { |
| 93 | 93 | $search = $this->object->createSearch(); |
| 94 | 94 | $search->setConditions( $search->compare( '==', 'customer.property.type.editor', $this->editor ) ); |
| 95 | - $results = $this->object->searchItems($search); |
|
| 95 | + $results = $this->object->searchItems( $search ); |
|
| 96 | 96 | |
| 97 | - if( ( $item = reset($results) ) === false ) { |
|
| 97 | + if( ( $item = reset( $results ) ) === false ) { |
|
| 98 | 98 | throw new \RuntimeException( 'No type item found' ); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | - $item->setId(null); |
|
| 101 | + $item->setId( null ); |
|
| 102 | 102 | $item->setCode( 'unitTestSave' ); |
| 103 | 103 | $resultSaved = $this->object->saveItem( $item ); |
| 104 | 104 | $itemSaved = $this->object->getItem( $item->getId() ); |
@@ -159,19 +159,19 @@ discard block |
||
| 159 | 159 | $expr[] = $search->compare( '>=', 'customer.property.type.ctime', '1970-01-01 00:00:00' ); |
| 160 | 160 | $expr[] = $search->compare( '==', 'customer.property.type.editor', $this->editor ); |
| 161 | 161 | |
| 162 | - $search->setConditions( $search->combine('&&', $expr) ); |
|
| 162 | + $search->setConditions( $search->combine( '&&', $expr ) ); |
|
| 163 | 163 | $results = $this->object->searchItems( $search, [], $total ); |
| 164 | 164 | $this->assertEquals( 1, count( $results ) ); |
| 165 | 165 | |
| 166 | 166 | |
| 167 | 167 | $search = $this->object->createSearch(); |
| 168 | 168 | $conditions = array( |
| 169 | - $search->compare( '=~', 'customer.property.type.code', 'newsletter'), |
|
| 169 | + $search->compare( '=~', 'customer.property.type.code', 'newsletter' ), |
|
| 170 | 170 | $search->compare( '==', 'customer.property.type.editor', $this->editor ) |
| 171 | 171 | ); |
| 172 | - $search->setConditions( $search->combine('&&', $conditions ) ); |
|
| 173 | - $search->setSlice(0, 1); |
|
| 174 | - $items = $this->object->searchItems( $search, [], $total); |
|
| 172 | + $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
| 173 | + $search->setSlice( 0, 1 ); |
|
| 174 | + $items = $this->object->searchItems( $search, [], $total ); |
|
| 175 | 175 | |
| 176 | 176 | $this->assertEquals( 1, count( $items ) ); |
| 177 | 177 | $this->assertEquals( 1, $total ); |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | |
| 185 | 185 | public function testGetSubManager() |
| 186 | 186 | { |
| 187 | - $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
| 188 | - $this->object->getSubManager('unknown'); |
|
| 187 | + $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
| 188 | + $this->object->getSubManager( 'unknown' ); |
|
| 189 | 189 | } |
| 190 | 190 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | public function testGetItem() |
| 54 | 54 | { |
| 55 | 55 | $search = $this->object->createSearch(); |
| 56 | - $search->setSlice(0, 1); |
|
| 56 | + $search->setSlice( 0, 1 ); |
|
| 57 | 57 | $results = $this->object->searchItems( $search ); |
| 58 | 58 | |
| 59 | 59 | if( ( $item = reset( $results ) ) === false ) { |
@@ -67,14 +67,14 @@ discard block |
||
| 67 | 67 | public function testSaveUpdateDeleteItem() |
| 68 | 68 | { |
| 69 | 69 | $search = $this->object->createSearch(); |
| 70 | - $search->setSlice(0, 1); |
|
| 70 | + $search->setSlice( 0, 1 ); |
|
| 71 | 71 | $items = $this->object->searchItems( $search ); |
| 72 | 72 | |
| 73 | 73 | if( ( $item = reset( $items ) ) === false ) { |
| 74 | 74 | throw new \RuntimeException( 'No item found' ); |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - $item->setId(null); |
|
| 77 | + $item->setId( null ); |
|
| 78 | 78 | $item->setDomain( 'unittest' ); |
| 79 | 79 | $resultSaved = $this->object->saveItem( $item ); |
| 80 | 80 | $itemSaved = $this->object->getItem( $item->getId() ); |
@@ -98,12 +98,12 @@ discard block |
||
| 98 | 98 | $this->assertEquals( $item->getDateEnd(), $itemSaved->getDateEnd() ); |
| 99 | 99 | $this->assertEquals( $item->getPosition(), $itemSaved->getPosition() ); |
| 100 | 100 | $this->assertEquals( $this->editor, $itemSaved->getEditor() ); |
| 101 | - $this->assertStringStartsWith(date('Y-m-d', time()), $itemSaved->getTimeCreated()); |
|
| 102 | - $this->assertStringStartsWith(date('Y-m-d', time()), $itemSaved->getTimeModified()); |
|
| 101 | + $this->assertStringStartsWith( date( 'Y-m-d', time() ), $itemSaved->getTimeCreated() ); |
|
| 102 | + $this->assertStringStartsWith( date( 'Y-m-d', time() ), $itemSaved->getTimeModified() ); |
|
| 103 | 103 | |
| 104 | 104 | $this->assertEquals( $this->editor, $itemSaved->getEditor() ); |
| 105 | 105 | $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeCreated() ); |
| 106 | - $this->assertRegExp('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified() ); |
|
| 106 | + $this->assertRegExp( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $itemSaved->getTimeModified() ); |
|
| 107 | 107 | |
| 108 | 108 | $this->assertEquals( $itemExp->getId(), $itemUpd->getId() ); |
| 109 | 109 | $this->assertEquals( $itemExp->getSiteId(), $itemUpd->getSiteId() ); |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | $this->assertInstanceOf( \Aimeos\MShop\Common\Item\Iface::class, $resultSaved ); |
| 123 | 123 | $this->assertInstanceOf( \Aimeos\MShop\Common\Item\Iface::class, $resultUpd ); |
| 124 | 124 | |
| 125 | - $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
| 125 | + $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
| 126 | 126 | $this->object->getItem( $itemSaved->getId() ); |
| 127 | 127 | } |
| 128 | 128 | |
@@ -192,10 +192,10 @@ discard block |
||
| 192 | 192 | |
| 193 | 193 | public function testGetSubManager() |
| 194 | 194 | { |
| 195 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type') ); |
|
| 196 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager('type', 'Typo3') ); |
|
| 195 | + $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager( 'type' ) ); |
|
| 196 | + $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager( 'type', 'Typo3' ) ); |
|
| 197 | 197 | |
| 198 | - $this->setExpectedException('\\Aimeos\\MShop\\Exception'); |
|
| 199 | - $this->object->getSubManager('unknown'); |
|
| 198 | + $this->setExpectedException( '\\Aimeos\\MShop\\Exception' ); |
|
| 199 | + $this->object->getSubManager( 'unknown' ); |
|
| 200 | 200 | } |
| 201 | 201 | } |