public function OrderTotalPriceTest::testMismatchedCurrencies in Commerce Core 8.2
::covers evaluate.
File
- modules/
order/ tests/ src/ Unit/ Plugin/ Commerce/ Condition/ OrderTotalPriceTest.php, line 38
Class
- OrderTotalPriceTest
- @coversDefaultClass \Drupal\commerce_order\Plugin\Commerce\Condition\OrderTotalPrice @group commerce
Namespace
Drupal\Tests\commerce_order\Unit\Plugin\Commerce\ConditionCode
public function testMismatchedCurrencies() {
$condition = new OrderTotalPrice([
'operator' => '==',
'amount' => [
'number' => '10.00',
'currency_code' => 'EUR',
],
], 'order_total_price', [
'entity_type' => 'commerce_order',
]);
$order = $this
->prophesize(OrderInterface::class);
$order
->getEntityTypeId()
->willReturn('commerce_order');
$order
->getTotalPrice()
->willReturn(new Price('10.00', 'USD'));
$order = $order
->reveal();
$this
->assertFalse($condition
->evaluate($order));
}