mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
Added test for price related quantity in DTOToEntityConverter
This commit is contained in:
parent
e233940f1f
commit
783a00ca2f
1 changed files with 2 additions and 0 deletions
|
@ -70,11 +70,13 @@ class DTOtoEntityConverterTest extends WebTestCase
|
||||||
price: "10.0",
|
price: "10.0",
|
||||||
currency_iso_code: 'CNY',
|
currency_iso_code: 'CNY',
|
||||||
includes_tax: true,
|
includes_tax: true,
|
||||||
|
price_related_quantity: 10.0,
|
||||||
);
|
);
|
||||||
|
|
||||||
$entity = $this->service->convertPrice($dto);
|
$entity = $this->service->convertPrice($dto);
|
||||||
$this->assertEquals($dto->minimum_discount_amount, $entity->getMinDiscountQuantity());
|
$this->assertEquals($dto->minimum_discount_amount, $entity->getMinDiscountQuantity());
|
||||||
$this->assertEquals((float) $dto->price, (float) (string) $entity->getPrice());
|
$this->assertEquals((float) $dto->price, (float) (string) $entity->getPrice());
|
||||||
|
$this->assertEquals($dto->price_related_quantity, $entity->getPriceRelatedQuantity());
|
||||||
|
|
||||||
//For non-base currencies, a new currency entity is created
|
//For non-base currencies, a new currency entity is created
|
||||||
$currency = $entity->getCurrency();
|
$currency = $entity->getCurrency();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue