11<?php
22/**
3- * Copyright © Magento, Inc. All rights reserved.
4- * See COPYING.txt for license details .
3+ * Copyright 2020 Adobe
4+ * All Rights Reserved .
55 */
66declare (strict_types=1 );
77
@@ -43,9 +43,9 @@ public function testAllGroups()
4343
4444 $ itemTiers = $ response ['products ' ]['items ' ][0 ]['price_tiers ' ];
4545 $ this ->assertCount (5 , $ itemTiers );
46- $ this ->assertEquals (round ( 8 * 2 , 2 ) , $ this ->getValueForQuantity (2 , $ itemTiers ));
47- $ this ->assertEquals (round ( 5 * 3 , 2 ) , $ this ->getValueForQuantity (3 , $ itemTiers ));
48- $ this ->assertEquals (round ( 6 * 3.2 , 2 ) , $ this ->getValueForQuantity (3.2 , $ itemTiers ));
46+ $ this ->assertEquals (8 , $ this ->getValueForQuantity (2 , $ itemTiers ));
47+ $ this ->assertEquals (5 , $ this ->getValueForQuantity (3 , $ itemTiers ));
48+ $ this ->assertEquals (6 , $ this ->getValueForQuantity (3.2 , $ itemTiers ));
4949 }
5050
5151 /**
@@ -65,11 +65,11 @@ public function testLoggedInCustomer()
6565
6666 $ itemTiers = $ response ['products ' ]['items ' ][0 ]['price_tiers ' ];
6767 $ this ->assertCount (5 , $ itemTiers );
68- $ this ->assertEquals (round ( 9.25 * 2 , 2 ) , $ this ->getValueForQuantity (2 , $ itemTiers ));
69- $ this ->assertEquals (round ( 8.25 * 3 , 2 ) , $ this ->getValueForQuantity (3 , $ itemTiers ));
70- $ this ->assertEquals (round ( 7.25 * 5 , 2 ) , $ this ->getValueForQuantity (5 , $ itemTiers ));
71- $ this ->assertEquals (round ( 9.00 * 7 , 2 ) , $ this ->getValueForQuantity (7 , $ itemTiers ));
72- $ this ->assertEquals (round ( 7.25 * 8 , 2 ) , $ this ->getValueForQuantity (8 , $ itemTiers ));
68+ $ this ->assertEquals (9.25 , $ this ->getValueForQuantity (2 , $ itemTiers ));
69+ $ this ->assertEquals (8.25 , $ this ->getValueForQuantity (3 , $ itemTiers ));
70+ $ this ->assertEquals (7.25 , $ this ->getValueForQuantity (5 , $ itemTiers ));
71+ $ this ->assertEquals (9.00 , $ this ->getValueForQuantity (7 , $ itemTiers ));
72+ $ this ->assertEquals (7.25 , $ this ->getValueForQuantity (8 , $ itemTiers ));
7373 }
7474
7575 /**
@@ -98,9 +98,9 @@ public function testSecondStoreViewWithCurrencyRate()
9898
9999 $ itemTiers = $ response ['products ' ]['items ' ][0 ]['price_tiers ' ];
100100 $ this ->assertCount (5 , $ itemTiers );
101- $ this ->assertEquals (round (( 9.25 * 2 ) * $ rate , 2 ), $ this ->getValueForQuantity (2 , $ itemTiers ));
102- $ this ->assertEquals (round (( 8.25 * 3 ) * $ rate , 2 ), $ this ->getValueForQuantity (3 , $ itemTiers ));
103- $ this ->assertEquals (round (( 7.25 * 5 ) * $ rate , 2 ), $ this ->getValueForQuantity (5 , $ itemTiers ));
101+ $ this ->assertEquals (round (9.25 * $ rate , 2 ), $ this ->getValueForQuantity (2 , $ itemTiers ));
102+ $ this ->assertEquals (round (8.25 * $ rate , 2 ), $ this ->getValueForQuantity (3 , $ itemTiers ));
103+ $ this ->assertEquals (round (7.25 * $ rate , 2 ), $ this ->getValueForQuantity (5 , $ itemTiers ));
104104 }
105105
106106 /**
@@ -113,8 +113,8 @@ public function testGetLowestPriceForGuest()
113113 $ response = $ this ->graphQlQuery ($ query );
114114 $ itemTiers = $ response ['products ' ]['items ' ][0 ]['price_tiers ' ];
115115 $ this ->assertCount (2 , $ itemTiers );
116- $ this ->assertEquals (round (( 8.25 * 7 ), 2 ) , $ this ->getValueForQuantity (7 , $ itemTiers ));
117- $ this ->assertEquals (round (( 7.25 * 8 ), 2 ) , $ this ->getValueForQuantity (8 , $ itemTiers ));
116+ $ this ->assertEquals (8.25 , $ this ->getValueForQuantity (7 , $ itemTiers ));
117+ $ this ->assertEquals (7.25 , $ this ->getValueForQuantity (8 , $ itemTiers ));
118118 }
119119
120120 /**
@@ -147,9 +147,7 @@ public function testProductTierPricesAreCorrectlyReturned()
147147 if (in_array ($ item ['sku ' ], $ productsWithTierPrices )) {
148148 $ this ->assertCount (1 , $ response ['products ' ]['items ' ][$ key ]['price_tiers ' ]);
149149 } else {
150- if (empty ($ response ['products ' ]['items ' ][$ key ]['price_tiers ' ])) {
151- $ this ->assertCount (0 , $ response ['products ' ]['items ' ][$ key ]['price_tiers ' ]);
152- }
150+ $ this ->assertCount (0 , $ response ['products ' ]['items ' ][$ key ]['price_tiers ' ]);
153151 }
154152 }
155153 }
0 commit comments