Skip to content

Commit

Permalink
style: updated formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
paales committed Aug 5, 2020
1 parent 4ca9153 commit 65517e8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
use ReachDigital\ISReservations\Model\MetaData\EncodeMetaData;
use ReachDigital\ISReservations\Model\ResourceModel\GetReservationsByMetadataList;
use ReachDigital\ISReservations\Model\SourceReservationBuilder;
use ReachDigital\ISReservations\Model\ResourceModel\CleanupSourceReservations;
use ReachDigital\ISReservations\Model\ResourceModel\GetSourceReservationsQuantity;

class GetReservationsByMetadataListTest extends TestCase
{
Expand Down Expand Up @@ -48,6 +46,8 @@ public function setUp()
*
* @magentoDbIsolation disabled
* @magentoDataFixture ../../../../vendor/reach-digital/magento2-inventory-source-reservations/ISReservations/Test/Integration/_files/clean_all_reservations.php
*
* @throws
*/
public function should_add_the_reservation_to_the_stock_amount()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ protected function tearDown()
* @dataProvider reindexRowDataProvider
*
* @magentoDbIsolation disabled
* @throws
*/
public function should_add_the_reservation_to_the_stock_amount(string $sourceCode, string $sku, float $quantity)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* See LICENSE.txt for license details.
*/

namespace ReachDigital\ISReservations\Test\Integration\Plugin\MagentoInventoryIndexer;

use Magento\Framework\Api\SearchCriteriaBuilder;
use Magento\Framework\Exception\CouldNotSaveException;
use Magento\Framework\Exception\InputException;
Expand Down Expand Up @@ -136,12 +138,12 @@ public function testAddSourceReservationsQtyToIsSalableConditions(
public function isSalableTestDataProvider(): array
{
return [
// source_qty, source_status, reserved_qty, min_qty, backorders, managed, expected_is_salable, expected_salable_qty
// source_qty, source_status, reserved_qty, min_qty, backorders, managed, is_salable, salable_qty
[10, 1, 0, 0, false, true, 1, 10],
[10, 1, -2, 0, false, true, 1, 8],
[10, 1, -5, 0, false, true, 1, 5],
[10, 1, -10, 0, false, true, 0, 0],
// [10, 1, -10, -1, true, true, 1, 0],
[10, 1, -10, -1, true, true, 1, 0],
];
}

Expand Down
11 changes: 7 additions & 4 deletions ISReservations/Test/Unit/Model/ReservationBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,23 @@ protected function setUp()
]);
}

/**
* @throws ValidationException
*/
public function testBuild()
{
$reservationData = [
SourceReservationInterface::RESERVATION_ID => null,
SourceReservationInterface::SOURCE_CODE => '1',
SourceReservationInterface::SKU => 'somesku',
SourceReservationInterface::SKU => 'some_sku',
SourceReservationInterface::QUANTITY => 11,
SourceReservationInterface::METADATA => 'some meta data',
];

$reservationMappedData = [
'reservationId' => null,
'sourceCode' => 1,
'sku' => 'somesku',
'sku' => 'some_sku',
'quantity' => 11,
'metadata' => 'some meta data',
];
Expand Down Expand Up @@ -154,7 +157,7 @@ public function getSettersAndValues(): array
{
return [
'with_missing_source_code' => [
['method' => 'setSku', 'argument' => 'somesku'],
['method' => 'setSku', 'argument' => 'some_sku'],
['method' => 'setQuantity', 'argument' => 11],
],
'with_missing_sku' => [
Expand All @@ -163,7 +166,7 @@ public function getSettersAndValues(): array
],
'with_missing_qty' => [
['method' => 'setSourceCode', 'argument' => '1'],
['method' => 'setSku', 'argument' => 'somesku'],
['method' => 'setSku', 'argument' => 'some_sku'],
],
];
}
Expand Down

0 comments on commit 65517e8

Please sign in to comment.