Skip to content

Commit d770920

Browse files
author
Cody Nguyen
committed
Apply issue fixing
1 parent 7580620 commit d770920

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

app/code/Magento/CatalogInventoryGraphQl/Model/Resolver/OnlyXLeftInStockResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private function getOnlyXLeftQty(ProductInterface $product): ?float
8686

8787
$stockLeft = $stockCurrentQty - $stockItem->getMinQty();
8888

89-
if ($stockLeft > 0 && $stockLeft <= $thresholdQty) {
89+
if ($stockLeft > 0 && $stockLeft <= $thresholdQty) {
9090
return (float)$stockCurrentQty;
9191
}
9292

app/code/Magento/CatalogInventoryGraphQl/Test/Unit/Model/Resolver/OnlyXLeftInStockResolverTest.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
declare(strict_types=1);
77

8-
namespace Magento\CustomerGraphQl\Test\Unit\Model\Resolver;
8+
namespace Magento\CatalogInventoryGraphQl\Test\Unit\Model\Resolver;
99

1010
use PHPUnit\Framework\TestCase;
1111
use Magento\CatalogInventoryGraphQl\Model\Resolver\OnlyXLeftInStockResolver;
@@ -21,7 +21,7 @@
2121
use Magento\CatalogInventory\Api\Data\StockStatusInterface;
2222

2323
/**
24-
* Test class for \Magento\CustomerGraphQl\Model\Resolver\GenerateCustomerToken
24+
* Test class for \Magento\CatalogInventoryGraphQl\Model\Resolver\OnlyXLeftInStockResolver
2525
*/
2626
class OnlyXLeftInStockResolverTest extends TestCase
2727
{
@@ -132,7 +132,6 @@ protected function setUp(): void
132132

133133
public function testResolve()
134134
{
135-
$xLeftInstockResult = 1;
136135
$stockCurrentQty = 3;
137136
$minQty = 2;
138137
$thresholdQty = 1;
@@ -146,7 +145,7 @@ public function testResolve()
146145
$this->scopeConfigMock->method('getValue')->willReturn($thresholdQty);
147146

148147
$this->assertEquals(
149-
$xLeftInstockResult,
148+
$stockCurrentQty,
150149
$this->resolver->resolve(
151150
$this->fieldMock,
152151
$this->contextMock,
@@ -158,7 +157,6 @@ public function testResolve()
158157

159158
public function testResolveOutStock()
160159
{
161-
$xLeftInstockResult = 1;
162160
$stockCurrentQty = 0;
163161
$minQty = 2;
164162
$thresholdQty = 1;
@@ -181,11 +179,8 @@ public function testResolveOutStock()
181179
);
182180
}
183181

184-
185-
186182
public function testResolveNoThresholdQty()
187183
{
188-
$xLeftInstockResult = 1;
189184
$stockCurrentQty = 3;
190185
$minQty = 2;
191186
$thresholdQty = null;
@@ -207,4 +202,4 @@ public function testResolveNoThresholdQty()
207202
)
208203
);
209204
}
210-
}
205+
}

0 commit comments

Comments
 (0)