@@ -57,9 +57,9 @@ discard block |
||
57 | 57 | { |
58 | 58 | // optimize autoloader with custom path |
59 | 59 | return $this->taskComposerInstall() |
60 | - ->preferDist() |
|
61 | - ->optimizeAutoloader() |
|
62 | - ->run(); |
|
60 | + ->preferDist() |
|
61 | + ->optimizeAutoloader() |
|
62 | + ->run(); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
@@ -71,9 +71,9 @@ discard block |
||
71 | 71 | { |
72 | 72 | // optimize autoloader with custom path |
73 | 73 | return $this->taskComposerUpdate() |
74 | - ->preferDist() |
|
75 | - ->optimizeAutoloader() |
|
76 | - ->run(); |
|
74 | + ->preferDist() |
|
75 | + ->optimizeAutoloader() |
|
76 | + ->run(); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
@@ -94,10 +94,10 @@ discard block |
||
94 | 94 | public function prepare() |
95 | 95 | { |
96 | 96 | return $this->taskFileSystemStack() |
97 | - ->mkdir($this->properties['dist.dir']) |
|
98 | - ->mkdir($this->properties['target.dir']) |
|
99 | - ->mkdir(sprintf('%s/reports', $this->properties['target.dir'])) |
|
100 | - ->run(); |
|
97 | + ->mkdir($this->properties['dist.dir']) |
|
98 | + ->mkdir($this->properties['target.dir']) |
|
99 | + ->mkdir(sprintf('%s/reports', $this->properties['target.dir'])) |
|
100 | + ->run(); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | /** |
@@ -167,8 +167,8 @@ discard block |
||
167 | 167 | |
168 | 168 | // run PHPUnit |
169 | 169 | return $this->taskPHPUnit(sprintf('%s/bin/phpunit', $this->properties['vendor.dir'])) |
170 | - ->configFile('phpunit.xml') |
|
171 | - ->run(); |
|
170 | + ->configFile('phpunit.xml') |
|
171 | + ->run(); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | /** |
@@ -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 | } |
@@ -93,8 +93,8 @@ discard block |
||
93 | 93 | |
94 | 94 | // mock the attribute bunch processor |
95 | 95 | $this->mockBunchProcessor = $this->getMockBuilder('TechDivision\Import\Attribute\Services\AttributeBunchProcessorInterface') |
96 | - ->setMethods(get_class_methods('TechDivision\Import\Attribute\Services\AttributeBunchProcessorInterface')) |
|
97 | - ->getMock(); |
|
96 | + ->setMethods(get_class_methods('TechDivision\Import\Attribute\Services\AttributeBunchProcessorInterface')) |
|
97 | + ->getMock(); |
|
98 | 98 | |
99 | 99 | // the observer instance we want to test |
100 | 100 | $this->observer = new CatalogAttributeObserver($this->mockBunchProcessor); |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | array(ColumnKeys::IS_FILTERABLE_IN_GRID), |
149 | 149 | array(ColumnKeys::SEARCH_WEIGHT), |
150 | 150 | array(ColumnKeys::ADDITIONAL_DATA) |
151 | - ) |
|
151 | + ) |
|
152 | 152 | ->willReturnOnConsecutiveCalls( |
153 | 153 | true, |
154 | 154 | false, |
@@ -190,23 +190,23 @@ discard block |
||
190 | 190 | |
191 | 191 | // mock the method that persists the entity |
192 | 192 | $this->mockBunchProcessor->expects($this->once()) |
193 | - ->method('persistCatalogAttribute') |
|
194 | - ->with( |
|
195 | - array_merge( |
|
196 | - array(MemberNames::ATTRIBUTE_ID => $lastAttributeId), |
|
197 | - $this->rawEntity, |
|
198 | - array(EntityStatus::MEMBER_NAME => EntityStatus::STATUS_CREATE) |
|
199 | - ) |
|
200 | - ) |
|
201 | - ->willReturn(null); |
|
193 | + ->method('persistCatalogAttribute') |
|
194 | + ->with( |
|
195 | + array_merge( |
|
196 | + array(MemberNames::ATTRIBUTE_ID => $lastAttributeId), |
|
197 | + $this->rawEntity, |
|
198 | + array(EntityStatus::MEMBER_NAME => EntityStatus::STATUS_CREATE) |
|
199 | + ) |
|
200 | + ) |
|
201 | + ->willReturn(null); |
|
202 | 202 | $this->mockBunchProcessor->expects($this->once()) |
203 | - ->method('loadRawEntity') |
|
204 | - ->willReturn( |
|
205 | - array_merge( |
|
206 | - array(MemberNames::ATTRIBUTE_ID => $lastAttributeId), |
|
207 | - $this->rawEntity |
|
208 | - ) |
|
209 | - ); |
|
203 | + ->method('loadRawEntity') |
|
204 | + ->willReturn( |
|
205 | + array_merge( |
|
206 | + array(MemberNames::ATTRIBUTE_ID => $lastAttributeId), |
|
207 | + $this->rawEntity |
|
208 | + ) |
|
209 | + ); |
|
210 | 210 | |
211 | 211 | // invoke the handle method |
212 | 212 | $this->assertSame($row, $this->observer->handle($mockSubject)); |
@@ -103,12 +103,12 @@ discard block |
||
103 | 103 | |
104 | 104 | // mock the attribute bunch processor |
105 | 105 | $this->mockBunchProcessor = $this->getMockBuilder(AttributeBunchProcessorInterface::class) |
106 | - ->setMethods(get_class_methods(AttributeBunchProcessorInterface::class)) |
|
107 | - ->getMock(); |
|
106 | + ->setMethods(get_class_methods(AttributeBunchProcessorInterface::class)) |
|
107 | + ->getMock(); |
|
108 | 108 | |
109 | 109 | $this->mockEntityMerger = $this->getMockBuilder(EntityMergerInterface::class) |
110 | - ->setMethods(get_class_methods(EntityMergerInterface::class)) |
|
111 | - ->getMock(); |
|
110 | + ->setMethods(get_class_methods(EntityMergerInterface::class)) |
|
111 | + ->getMock(); |
|
112 | 112 | |
113 | 113 | // the observer instance we want to test |
114 | 114 | $this->observer = new CatalogAttributeUpdateObserver($this->mockBunchProcessor, $this->mockEntityMerger); |
@@ -190,36 +190,36 @@ 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 | - ->willReturn( |
|
205 | - array_merge( |
|
206 | - array(MemberNames::ATTRIBUTE_ID => $lastAttributeId), |
|
207 | - $this->rawEntity |
|
208 | - ) |
|
209 | - ); |
|
203 | + ->method('loadRawEntity') |
|
204 | + ->willReturn( |
|
205 | + array_merge( |
|
206 | + array(MemberNames::ATTRIBUTE_ID => $lastAttributeId), |
|
207 | + $this->rawEntity |
|
208 | + ) |
|
209 | + ); |
|
210 | 210 | |
211 | 211 | // mock the entity merger method |
212 | 212 | $this->mockEntityMerger->expects($this->any()) |
213 | - ->method('merge') |
|
214 | - ->willReturnCallback(function ($observer, $entity, $attr) use ($headers) { |
|
215 | - foreach (array_keys($attr) as $key) { |
|
216 | - if (isset($headers[$key])) { |
|
217 | - continue; |
|
218 | - } |
|
219 | - unset($attr[$key]); |
|
220 | - } |
|
221 | - return $attr; |
|
222 | - }); |
|
213 | + ->method('merge') |
|
214 | + ->willReturnCallback(function ($observer, $entity, $attr) use ($headers) { |
|
215 | + foreach (array_keys($attr) as $key) { |
|
216 | + if (isset($headers[$key])) { |
|
217 | + continue; |
|
218 | + } |
|
219 | + unset($attr[$key]); |
|
220 | + } |
|
221 | + return $attr; |
|
222 | + }); |
|
223 | 223 | |
224 | 224 | // invoke the handle method |
225 | 225 | $this->assertSame($row, $this->observer->handle($mockSubject)); |
@@ -403,36 +403,36 @@ discard block |
||
403 | 403 | |
404 | 404 | // mock the method that loads the existing entity |
405 | 405 | $this->mockBunchProcessor->expects($this->once()) |
406 | - ->method('loadCatalogAttribute') |
|
407 | - ->with($lastAttributeId) |
|
408 | - ->willReturn($existingEntity); |
|
406 | + ->method('loadCatalogAttribute') |
|
407 | + ->with($lastAttributeId) |
|
408 | + ->willReturn($existingEntity); |
|
409 | 409 | // mock the method that persists the entity |
410 | 410 | $this->mockBunchProcessor->expects($this->once()) |
411 | - ->method('persistCatalogAttribute') |
|
412 | - ->with($expectedEntity) |
|
413 | - ->willReturn(null); |
|
411 | + ->method('persistCatalogAttribute') |
|
412 | + ->with($expectedEntity) |
|
413 | + ->willReturn(null); |
|
414 | 414 | // mock the method that loads the raw entity |
415 | 415 | $this->mockBunchProcessor->expects($this->once()) |
416 | - ->method('loadRawEntity') |
|
417 | - ->willReturn( |
|
418 | - array_merge( |
|
419 | - array(MemberNames::ATTRIBUTE_ID => $lastAttributeId), |
|
420 | - $this->rawEntity |
|
421 | - ) |
|
422 | - ); |
|
416 | + ->method('loadRawEntity') |
|
417 | + ->willReturn( |
|
418 | + array_merge( |
|
419 | + array(MemberNames::ATTRIBUTE_ID => $lastAttributeId), |
|
420 | + $this->rawEntity |
|
421 | + ) |
|
422 | + ); |
|
423 | 423 | |
424 | 424 | // mock the entity merger method |
425 | 425 | $this->mockEntityMerger->expects($this->any()) |
426 | - ->method('merge') |
|
427 | - ->willReturnCallback(function ($observer, $entity, $attr) use ($headers) { |
|
428 | - foreach (array_keys($attr) as $key) { |
|
429 | - if (isset($headers[$key])) { |
|
430 | - continue; |
|
431 | - } |
|
432 | - unset($attr[$key]); |
|
433 | - } |
|
434 | - return $attr; |
|
435 | - }); |
|
426 | + ->method('merge') |
|
427 | + ->willReturnCallback(function ($observer, $entity, $attr) use ($headers) { |
|
428 | + foreach (array_keys($attr) as $key) { |
|
429 | + if (isset($headers[$key])) { |
|
430 | + continue; |
|
431 | + } |
|
432 | + unset($attr[$key]); |
|
433 | + } |
|
434 | + return $attr; |
|
435 | + }); |
|
436 | 436 | // invoke the handle method |
437 | 437 | $this->assertSame($row, $this->observer->handle($mockSubject)); |
438 | 438 | } |