woocommerce-paypal-payments/tests/PHPUnit/ApiClient/Entity/MoneyTest.php

24 lines
563 B
PHP
Raw Normal View History

2020-08-31 13:38:54 +03:00
<?php
declare(strict_types=1);
2020-09-14 07:51:45 +03:00
namespace WooCommerce\PayPalCommerce\ApiClient\Entity;
2020-08-31 13:38:54 +03:00
2020-09-14 07:51:45 +03:00
use WooCommerce\PayPalCommerce\ApiClient\TestCase;
2020-08-31 13:38:54 +03:00
class MoneyTest extends TestCase
{
public function test()
{
$testee = new Money(1.10, 'currencyCode');
$this->assertEquals(1.10, $testee->value());
2020-09-01 09:47:36 +03:00
$this->assertEquals('currencyCode', $testee->currency_code());
2020-08-31 13:38:54 +03:00
$expected = [
'currency_code' => 'currencyCode',
'value' => 1.10,
];
2020-09-01 09:47:36 +03:00
$this->assertEquals($expected, $testee->to_array());
2020-08-31 13:38:54 +03:00
}
}