@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | { |
61 | 61 | // optimize autoloader with custom path |
62 | 62 | $this->taskComposerInstall() |
63 | - ->preferDist() |
|
64 | - ->optimizeAutoloader() |
|
65 | - ->run(); |
|
63 | + ->preferDist() |
|
64 | + ->optimizeAutoloader() |
|
65 | + ->run(); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -74,9 +74,9 @@ discard block |
||
74 | 74 | { |
75 | 75 | // optimize autoloader with custom path |
76 | 76 | $this->taskComposerUpdate() |
77 | - ->preferDist() |
|
78 | - ->optimizeAutoloader() |
|
79 | - ->run(); |
|
77 | + ->preferDist() |
|
78 | + ->optimizeAutoloader() |
|
79 | + ->run(); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -97,10 +97,10 @@ discard block |
||
97 | 97 | public function prepare() |
98 | 98 | { |
99 | 99 | $this->taskFileSystemStack() |
100 | - ->mkdir($this->properties['dist.dir']) |
|
101 | - ->mkdir($this->properties['target.dir']) |
|
102 | - ->mkdir(sprintf('%s/reports', $this->properties['target.dir'])) |
|
103 | - ->run(); |
|
100 | + ->mkdir($this->properties['dist.dir']) |
|
101 | + ->mkdir($this->properties['target.dir']) |
|
102 | + ->mkdir(sprintf('%s/reports', $this->properties['target.dir'])) |
|
103 | + ->run(); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
@@ -170,8 +170,8 @@ discard block |
||
170 | 170 | |
171 | 171 | // run PHPUnit |
172 | 172 | $this->taskPHPUnit(sprintf('%s/bin/phpunit', $this->properties['vendor.dir'])) |
173 | - ->configFile('phpunit.xml') |
|
174 | - ->run(); |
|
173 | + ->configFile('phpunit.xml') |
|
174 | + ->run(); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | /** |
@@ -116,7 +116,7 @@ |
||
116 | 116 | /** |
117 | 117 | * Return's the product bunch processor instance. |
118 | 118 | * |
119 | - * @return \TechDivision\Import\Product\Services\ProductBunchProcessorInterface The product bunch processor instance |
|
119 | + * @return ProductUrlRewriteProcessorInterface The product bunch processor instance |
|
120 | 120 | */ |
121 | 121 | protected function getProductUrlRewriteProcessor() |
122 | 122 | { |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | |
66 | 66 | // initialize a mock processor instance |
67 | 67 | $this->mockProductUrlRewriteProcessor = $this->getMockBuilder('TechDivision\Import\Product\UrlRewrite\Services\ProductUrlRewriteProcessorInterface') |
68 | - ->setMethods(get_class_methods('TechDivision\Import\Product\UrlRewrite\Services\ProductUrlRewriteProcessorInterface')) |
|
69 | - ->getMock(); |
|
68 | + ->setMethods(get_class_methods('TechDivision\Import\Product\UrlRewrite\Services\ProductUrlRewriteProcessorInterface')) |
|
69 | + ->getMock(); |
|
70 | 70 | |
71 | 71 | // initialize the observer |
72 | 72 | $this->observer = new UrlRewriteObserver($this->mockProductUrlRewriteProcessor); |
@@ -250,28 +250,28 @@ discard block |
||
250 | 250 | |
251 | 251 | // initialize the categories |
252 | 252 | $categories = array( |
253 | - $path1 = 'Default Category' => array(MemberNames::ENTITY_ID => 2, MemberNames::PARENT_ID => 1, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => null, MemberNames::PATH => $path1), |
|
254 | - $path2 = 'Default Category/Men' => array(MemberNames::ENTITY_ID => 3, MemberNames::PARENT_ID => 2, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men', MemberNames::PATH => $path2), |
|
255 | - $path3 = 'Default Category/Men/Tops' => array(MemberNames::ENTITY_ID => 4, MemberNames::PARENT_ID => 3, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men/tops-men', MemberNames::PATH => $path3), |
|
256 | - $path4 = 'Default Category/Men/Tops/Hoodies & Sweatshirts' => array(MemberNames::ENTITY_ID => 5, MemberNames::PARENT_ID => 4, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men/tops-men/hoodies-and-sweatshirts-men', MemberNames::PATH => $path4), |
|
257 | - $path5 = 'Default Category/Collections' => array(MemberNames::ENTITY_ID => 6, MemberNames::PARENT_ID => 3, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'collections', MemberNames::PATH => $path5), |
|
258 | - $path6 = 'Default Category/Collections/Eco Friendly' => array(MemberNames::ENTITY_ID => 7, MemberNames::PARENT_ID => 6, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'collections/eco-friendly', MemberNames::PATH => $path6), |
|
253 | + $path1 = 'Default Category' => array(MemberNames::ENTITY_ID => 2, MemberNames::PARENT_ID => 1, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => null, MemberNames::PATH => $path1), |
|
254 | + $path2 = 'Default Category/Men' => array(MemberNames::ENTITY_ID => 3, MemberNames::PARENT_ID => 2, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men', MemberNames::PATH => $path2), |
|
255 | + $path3 = 'Default Category/Men/Tops' => array(MemberNames::ENTITY_ID => 4, MemberNames::PARENT_ID => 3, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men/tops-men', MemberNames::PATH => $path3), |
|
256 | + $path4 = 'Default Category/Men/Tops/Hoodies & Sweatshirts' => array(MemberNames::ENTITY_ID => 5, MemberNames::PARENT_ID => 4, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men/tops-men/hoodies-and-sweatshirts-men', MemberNames::PATH => $path4), |
|
257 | + $path5 = 'Default Category/Collections' => array(MemberNames::ENTITY_ID => 6, MemberNames::PARENT_ID => 3, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'collections', MemberNames::PATH => $path5), |
|
258 | + $path6 = 'Default Category/Collections/Eco Friendly' => array(MemberNames::ENTITY_ID => 7, MemberNames::PARENT_ID => 6, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'collections/eco-friendly', MemberNames::PATH => $path6), |
|
259 | 259 | ); |
260 | 260 | |
261 | 261 | // create a mock configuration |
262 | 262 | $mockSubjectConfiguration = $this->getMockBuilder('TechDivision\Import\Configuration\SubjectConfigurationInterface') |
263 | - ->setMethods(get_class_methods('TechDivision\Import\Configuration\SubjectConfigurationInterface')) |
|
264 | - ->getMock(); |
|
263 | + ->setMethods(get_class_methods('TechDivision\Import\Configuration\SubjectConfigurationInterface')) |
|
264 | + ->getMock(); |
|
265 | 265 | |
266 | 266 | // mock the methods |
267 | 267 | $mockSubjectConfiguration->expects($this->once()) |
268 | - ->method('getDelimiter') |
|
269 | - ->willReturn(','); |
|
268 | + ->method('getDelimiter') |
|
269 | + ->willReturn(','); |
|
270 | 270 | |
271 | 271 | // mock the system logger |
272 | 272 | $mockSystemLogger = $this->getMockBuilder('Psr\Log\LoggerInterface') |
273 | - ->setMethods(get_class_methods('Psr\Log\LoggerInterface')) |
|
274 | - ->getMock(); |
|
273 | + ->setMethods(get_class_methods('Psr\Log\LoggerInterface')) |
|
274 | + ->getMock(); |
|
275 | 275 | |
276 | 276 | // create a mock subject |
277 | 277 | $mockSubject = $this->getMockBuilder('TechDivision\Import\Product\UrlRewrite\Subjects\UrlRewriteSubject') |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | |
66 | 66 | // initialize a mock processor instance |
67 | 67 | $this->mockProductUrlRewriteProcessor = $this->getMockBuilder('TechDivision\Import\Product\UrlRewrite\Services\ProductUrlRewriteProcessorInterface') |
68 | - ->setMethods(get_class_methods('TechDivision\Import\Product\UrlRewrite\Services\ProductUrlRewriteProcessorInterface')) |
|
69 | - ->getMock(); |
|
68 | + ->setMethods(get_class_methods('TechDivision\Import\Product\UrlRewrite\Services\ProductUrlRewriteProcessorInterface')) |
|
69 | + ->getMock(); |
|
70 | 70 | |
71 | 71 | // initialize the observer |
72 | 72 | $this->observer = new UrlRewriteUpdateObserver($this->mockProductUrlRewriteProcessor); |
@@ -103,30 +103,30 @@ discard block |
||
103 | 103 | |
104 | 104 | // initialize the categories |
105 | 105 | $categories = array( |
106 | - $path1 = 'Default Category' => array(MemberNames::ENTITY_ID => 2, MemberNames::PARENT_ID => 1, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => null, MemberNames::PATH => $path1), |
|
107 | - $path2 = 'Default Category/Men' => array(MemberNames::ENTITY_ID => 3, MemberNames::PARENT_ID => 2, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men', MemberNames::PATH => $path2), |
|
108 | - $path3 = 'Default Category/Men/Tops' => array(MemberNames::ENTITY_ID => 4, MemberNames::PARENT_ID => 3, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men/tops-men', MemberNames::PATH => $path3), |
|
109 | - $path4 = 'Default Category/Men/Tops/Hoodies & Sweatshirts' => array(MemberNames::ENTITY_ID => 5, MemberNames::PARENT_ID => 4, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men/tops-men/hoodies-and-sweatshirts-men', MemberNames::PATH => $path4), |
|
110 | - $path5 = 'Default Category/Collections' => array(MemberNames::ENTITY_ID => 6, MemberNames::PARENT_ID => 3, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'collections', MemberNames::PATH => $path5), |
|
111 | - $path6 = 'Default Category/Collections/Eco Friendly' => array(MemberNames::ENTITY_ID => 7, MemberNames::PARENT_ID => 6, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'collections/eco-friendly', MemberNames::PATH => $path6), |
|
112 | - $path7 = 'Default Category/Collections/Old' => array(MemberNames::ENTITY_ID => 8, MemberNames::PARENT_ID => 6, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'collections/old', MemberNames::PATH => $path7), |
|
113 | - $path8 = 'Default Category/Men/Old' => array(MemberNames::ENTITY_ID => 9, MemberNames::PARENT_ID => 3, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men/old', MemberNames::PATH => $path8), |
|
106 | + $path1 = 'Default Category' => array(MemberNames::ENTITY_ID => 2, MemberNames::PARENT_ID => 1, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => null, MemberNames::PATH => $path1), |
|
107 | + $path2 = 'Default Category/Men' => array(MemberNames::ENTITY_ID => 3, MemberNames::PARENT_ID => 2, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men', MemberNames::PATH => $path2), |
|
108 | + $path3 = 'Default Category/Men/Tops' => array(MemberNames::ENTITY_ID => 4, MemberNames::PARENT_ID => 3, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men/tops-men', MemberNames::PATH => $path3), |
|
109 | + $path4 = 'Default Category/Men/Tops/Hoodies & Sweatshirts' => array(MemberNames::ENTITY_ID => 5, MemberNames::PARENT_ID => 4, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men/tops-men/hoodies-and-sweatshirts-men', MemberNames::PATH => $path4), |
|
110 | + $path5 = 'Default Category/Collections' => array(MemberNames::ENTITY_ID => 6, MemberNames::PARENT_ID => 3, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'collections', MemberNames::PATH => $path5), |
|
111 | + $path6 = 'Default Category/Collections/Eco Friendly' => array(MemberNames::ENTITY_ID => 7, MemberNames::PARENT_ID => 6, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'collections/eco-friendly', MemberNames::PATH => $path6), |
|
112 | + $path7 = 'Default Category/Collections/Old' => array(MemberNames::ENTITY_ID => 8, MemberNames::PARENT_ID => 6, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'collections/old', MemberNames::PATH => $path7), |
|
113 | + $path8 = 'Default Category/Men/Old' => array(MemberNames::ENTITY_ID => 9, MemberNames::PARENT_ID => 3, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men/old', MemberNames::PATH => $path8), |
|
114 | 114 | ); |
115 | 115 | |
116 | 116 | // create a mock configuration |
117 | 117 | $mockSubjectConfiguration = $this->getMockBuilder('TechDivision\Import\Configuration\SubjectConfigurationInterface') |
118 | - ->setMethods(get_class_methods('TechDivision\Import\Configuration\SubjectConfigurationInterface')) |
|
119 | - ->getMock(); |
|
118 | + ->setMethods(get_class_methods('TechDivision\Import\Configuration\SubjectConfigurationInterface')) |
|
119 | + ->getMock(); |
|
120 | 120 | |
121 | 121 | // mock the methods |
122 | 122 | $mockSubjectConfiguration->expects($this->once()) |
123 | - ->method('getDelimiter') |
|
124 | - ->willReturn(','); |
|
123 | + ->method('getDelimiter') |
|
124 | + ->willReturn(','); |
|
125 | 125 | |
126 | 126 | // mock the system logger |
127 | 127 | $mockSystemLogger = $this->getMockBuilder('Psr\Log\LoggerInterface') |
128 | - ->setMethods(get_class_methods('Psr\Log\LoggerInterface')) |
|
129 | - ->getMock(); |
|
128 | + ->setMethods(get_class_methods('Psr\Log\LoggerInterface')) |
|
129 | + ->getMock(); |
|
130 | 130 | |
131 | 131 | // the found URL rewrites |
132 | 132 | $urlRewrites = array( |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | ->method('getUrlRewritesByEntityTypeAndEntityIdAndStoreId') |
313 | 313 | ->with(UrlRewriteObserver::ENTITY_TYPE, $entityId, $storeId) |
314 | 314 | ->willReturn($urlRewrites); |
315 | - $this->mockProductUrlRewriteProcessor->expects($this->exactly(6)) |
|
315 | + $this->mockProductUrlRewriteProcessor->expects($this->exactly(6)) |
|
316 | 316 | ->method('persistUrlRewrite') |
317 | 317 | ->withConsecutive( |
318 | 318 | array( |
@@ -151,7 +151,7 @@ |
||
151 | 151 | * Commits a transaction, returning the database connection to autocommit mode until the next call to |
152 | 152 | * ProductProcessor::beginTransaction() starts a new transaction. |
153 | 153 | * |
154 | - * @return boolean Returns TRUE on success or FALSE on failure |
|
154 | + * @return boolean|null Returns TRUE on success or FALSE on failure |
|
155 | 155 | * @link http://php.net/manual/en/pdo.commit.php |
156 | 156 | */ |
157 | 157 | public function commit() |