Skip to content

Commit 690c9ee

Browse files
committed
Add more testing utilities
1 parent 10c653f commit 690c9ee

File tree

8 files changed

+680
-22
lines changed

8 files changed

+680
-22
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
},
3535
"autoload-dev": {
3636
"psr-4": {
37-
"EcomDev\\ProductDataPreLoader\\": "tests"
37+
"EcomDev\\ProductDataPreLoader\\": ["tests/unit", "tests/util"]
3838
}
3939
},
4040
"scripts": {

src/DataService/MagentoScopeFilter.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -86,18 +86,4 @@ public function getCustomerGroupId(): int
8686
{
8787
return (int)($this->options['group_id'] ?? $this->customerGroupProvider->getCustomerGroupId());
8888
}
89-
90-
/**
91-
* {@inheritDoc}
92-
*/
93-
public function getCacheKey(): string
94-
{
95-
$customerGroupId = 0;
96-
97-
if ($this->hasCustomerGroupId()) {
98-
$customerGroupId = $this->getCustomerGroupId();
99-
}
100-
101-
return sprintf('%d-%d-%d', $this->getWebsiteId(), $customerGroupId, $this->getStoreId());
102-
}
10389
}

src/DataService/ScopeFilter.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,4 @@ public function hasCustomerGroupId(): bool;
4343
* @return int
4444
*/
4545
public function getCustomerGroupId(): int;
46-
47-
/**
48-
* Returns a cache for grouping data loaders together
49-
*
50-
* @return string
51-
*/
52-
public function getCacheKey(): string;
5346
}

tests/MagentoProductWrapperTest.php renamed to tests/unit/MagentoProductWrapperTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public function updatesFieldsInProductDataStorage()
8080
*/
8181
private function createProduct(array $data = []): Product
8282
{
83+
/** @var Product $product */
8384
$product = (new FakeObjectManager())->get(Product::class);
8485
$product->setData($data);
8586

tests/unit/MagentoScopeFilterTest.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
/**
3+
* Copyright © EcomDev B.V. All rights reserved.
4+
* See LICENSE for license details.
5+
*/
6+
7+
declare(strict_types=1);
8+
9+
namespace EcomDev\ProductDataPreLoader;
10+
11+
12+
use PHPUnit\Framework\TestCase;
13+
14+
class MagentoScopeFilterTest extends TestCase
15+
{
16+
/** @test */
17+
public function magento()
18+
{
19+
20+
}
21+
}

0 commit comments

Comments
 (0)