Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
feat(ShippingMethod): add isMatching flag to shipping rates
Browse files Browse the repository at this point in the history
  • Loading branch information
Jens Schulze committed Jun 2, 2017
1 parent 1f40cef commit c6b4328
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Core/Model/ShippingMethod/ShippingRate.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* @method ShippingRate setPrice(Money $price = null)
* @method Money getFreeAbove()
* @method ShippingRate setFreeAbove(Money $freeAbove = null)
* @method bool getIsMatching()
* @method ShippingRate setIsMatching(bool $isMatching = null)
*/
class ShippingRate extends JsonObject
{
Expand All @@ -23,6 +25,7 @@ public function fieldDefinitions()
return [
'price' => [static::TYPE => Money::class],
'freeAbove' => [static::TYPE => Money::class],
'isMatching' => [static::TYPE => 'bool']
];
}
}
1 change: 1 addition & 0 deletions tests/fixtures/models.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ shippingRate:
fields:
- price
- freeAbove
- isMatching

state:
domain: state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public function testByLocation()
$response = $request->executeWithClient($this->getClient(), ['X-Vrap-Disable-Validation' => 'response']);
$result = $request->mapResponse($response);

$this->assertTrue($result->current()->getZoneRates()->current()->getShippingRates()->current()->getIsMatching());
$this->assertInstanceOf(ShippingMethodCollection::class, $result);
$this->assertSame($shippingMethod->getId(), $result->current()->getId());
}
Expand Down

1 comment on commit c6b4328

@jenschude
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closes #316

Please # to comment.