2021-08-03 14:36:18 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
|
|
|
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
|
|
|
*
|
|
|
|
* @license https://www.elastic.co/licensing/elastic-license
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Tests\Unit;
|
|
|
|
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
|
|
|
|
class MollieAmountFormatTest extends TestCase
|
|
|
|
{
|
|
|
|
/**
|
2022-06-21 11:57:17 +02:00
|
|
|
* @covers \App\PaymentDrivers\MolliePaymentDriver::convertToMollieAmount()
|
2021-08-03 14:36:18 +02:00
|
|
|
*/
|
|
|
|
public function testFormatterIsWorkingCorrectly()
|
|
|
|
{
|
|
|
|
$this->assertEquals('1000.00', \number_format((float) 1000, 2, '.', ''));
|
|
|
|
|
2022-06-21 11:57:17 +02:00
|
|
|
$this->assertEquals('1000.00', \number_format((float) '1000', 2, '.', ''));
|
2021-08-03 14:36:18 +02:00
|
|
|
|
2022-06-21 11:57:17 +02:00
|
|
|
$this->assertEquals('1000.00', \number_format((float) '1000.00', 2, '.', ''));
|
2021-08-03 14:36:18 +02:00
|
|
|
|
2022-06-21 11:57:17 +02:00
|
|
|
$this->assertEquals('1000.00', \number_format((float) '1000.00000', 2, '.', ''));
|
2021-08-03 14:36:18 +02:00
|
|
|
}
|
|
|
|
}
|