@@ -63,8 +63,8 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | // mock the attribute bunch processor |
| 65 | 65 | $this->mockBunchProcessor = $this->getMockBuilder('TechDivision\Import\Attribute\Services\AttributeBunchProcessorInterface') |
| 66 | - ->setMethods(get_class_methods('TechDivision\Import\Attribute\Services\AttributeBunchProcessorInterface')) |
|
| 67 | - ->getMock(); |
|
| 66 | + ->setMethods(get_class_methods('TechDivision\Import\Attribute\Services\AttributeBunchProcessorInterface')) |
|
| 67 | + ->getMock(); |
|
| 68 | 68 | |
| 69 | 69 | // the observer instance we want to test |
| 70 | 70 | $this->observer = new CatalogAttributeUpdateObserver($this->mockBunchProcessor); |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | array(ColumnKeys::IS_FILTERABLE_IN_GRID), |
| 118 | 118 | array(ColumnKeys::SEARCH_WEIGHT), |
| 119 | 119 | array(ColumnKeys::ADDITIONAL_DATA) |
| 120 | - ) |
|
| 120 | + ) |
|
| 121 | 121 | ->willReturnOnConsecutiveCalls( |
| 122 | 122 | true, |
| 123 | 123 | false, |
@@ -190,18 +190,18 @@ discard block |
||
| 190 | 190 | |
| 191 | 191 | // mock the method that loads the existing entity |
| 192 | 192 | $this->mockBunchProcessor->expects($this->once()) |
| 193 | - ->method('loadCatalogAttribute') |
|
| 194 | - ->with($lastAttributeId) |
|
| 195 | - ->willReturn($existingEntity); |
|
| 193 | + ->method('loadCatalogAttribute') |
|
| 194 | + ->with($lastAttributeId) |
|
| 195 | + ->willReturn($existingEntity); |
|
| 196 | 196 | // mock the method that persists the entity |
| 197 | 197 | $this->mockBunchProcessor->expects($this->once()) |
| 198 | - ->method('persistCatalogAttribute') |
|
| 199 | - ->with($expectedEntity) |
|
| 200 | - ->willReturn(null); |
|
| 198 | + ->method('persistCatalogAttribute') |
|
| 199 | + ->with($expectedEntity) |
|
| 200 | + ->willReturn(null); |
|
| 201 | 201 | // mock the method that loads the raw entity |
| 202 | 202 | $this->mockBunchProcessor->expects($this->once()) |
| 203 | - ->method('loadRawEntity') |
|
| 204 | - ->willReturnArgument(1); |
|
| 203 | + ->method('loadRawEntity') |
|
| 204 | + ->willReturnArgument(1); |
|
| 205 | 205 | // invoke the handle method |
| 206 | 206 | $this->assertSame($row, $this->observer->handle($mockSubject)); |
| 207 | 207 | } |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | array(ColumnKeys::ADDITIONAL_DATA), |
| 314 | 314 | array(ColumnKeys::ATTRIBUTE_OPTION_VALUES), |
| 315 | 315 | array(ColumnKeys::ATTRIBUTE_OPTION_SWATCH) |
| 316 | - ) |
|
| 316 | + ) |
|
| 317 | 317 | ->willReturnOnConsecutiveCalls( |
| 318 | 318 | 0, |
| 319 | 319 | 1, |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | 23, |
| 364 | 364 | 7, |
| 365 | 365 | 8 |
| 366 | - ); |
|
| 366 | + ); |
|
| 367 | 367 | $mockSubject->expects($this->once()) |
| 368 | 368 | ->method('hasBeenProcessed') |
| 369 | 369 | ->with($attributeCode) |
@@ -448,18 +448,18 @@ discard block |
||
| 448 | 448 | |
| 449 | 449 | // mock the method that loads the existing entity |
| 450 | 450 | $this->mockBunchProcessor->expects($this->once()) |
| 451 | - ->method('loadCatalogAttribute') |
|
| 452 | - ->with($lastAttributeId) |
|
| 453 | - ->willReturn($existingEntity); |
|
| 451 | + ->method('loadCatalogAttribute') |
|
| 452 | + ->with($lastAttributeId) |
|
| 453 | + ->willReturn($existingEntity); |
|
| 454 | 454 | // mock the method that persists the entity |
| 455 | 455 | $this->mockBunchProcessor->expects($this->once()) |
| 456 | - ->method('persistCatalogAttribute') |
|
| 457 | - ->with($expectedEntity) |
|
| 458 | - ->willReturn(null); |
|
| 456 | + ->method('persistCatalogAttribute') |
|
| 457 | + ->with($expectedEntity) |
|
| 458 | + ->willReturn(null); |
|
| 459 | 459 | // mock the method that loads the raw entity |
| 460 | 460 | $this->mockBunchProcessor->expects($this->once()) |
| 461 | - ->method('loadRawEntity') |
|
| 462 | - ->willReturnArgument(1); |
|
| 461 | + ->method('loadRawEntity') |
|
| 462 | + ->willReturnArgument(1); |
|
| 463 | 463 | |
| 464 | 464 | // invoke the handle method |
| 465 | 465 | $this->assertSame($row, $this->observer->handle($mockSubject)); |
@@ -57,14 +57,14 @@ |
||
| 57 | 57 | |
| 58 | 58 | // add debug log entry |
| 59 | 59 | $this->getSubject() |
| 60 | - ->getSystemLogger() |
|
| 61 | - ->debug( |
|
| 62 | - sprintf( |
|
| 63 | - 'Successfully copied image %s for swatch with id %s', |
|
| 64 | - $imagePath, |
|
| 65 | - $attributeOptionSwatch[MemberNames::SWATCH_ID] |
|
| 66 | - ) |
|
| 67 | - ); |
|
| 60 | + ->getSystemLogger() |
|
| 61 | + ->debug( |
|
| 62 | + sprintf( |
|
| 63 | + 'Successfully copied image %s for swatch with id %s', |
|
| 64 | + $imagePath, |
|
| 65 | + $attributeOptionSwatch[MemberNames::SWATCH_ID] |
|
| 66 | + ) |
|
| 67 | + ); |
|
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | } |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | )); |
| 48 | 48 | |
| 49 | 49 | // skip this step for color swatches and text swatches |
| 50 | - if (isset($attributeOptionSwatch[MemberNames::TYPE]) && $attributeOptionSwatch[MemberNames::TYPE] === SwatchTypes::IMAGE) { |
|
| 50 | + if (isset($attributeOptionSwatch[MemberNames::TYPE]) && $attributeOptionSwatch[MemberNames::TYPE] === SwatchTypes::IMAGE) { |
|
| 51 | 51 | // upload the file to the configured directory |
| 52 | 52 | $imagePath = $this->getSubject()->uploadFile($attributeOptionSwatch[MemberNames::VALUE]); |
| 53 | 53 | |
@@ -86,8 +86,8 @@ |
||
| 86 | 86 | // load the columns from the metadata |
| 87 | 87 | $columns = array_filter( |
| 88 | 88 | $columnMetadataLoader->load($entityType), |
| 89 | - function ($value) { |
|
| 90 | - return $value['Key'] !== 'PRI' && $value['Null'] === 'NO' ; |
|
| 89 | + function($value) { |
|
| 90 | + return $value['Key'] !== 'PRI' && $value['Null'] === 'NO'; |
|
| 91 | 91 | } |
| 92 | 92 | ); |
| 93 | 93 | // initialize the raw entities and their default values, if available |