88namespace Magento \Quote \Model ;
99
1010use Magento \Catalog \Api \ProductRepositoryInterface ;
11+ use Magento \Catalog \Test \Fixture \Product as ProductFixture ;
1112use Magento \Checkout \Model \Session as CheckoutSession ;
1213use Magento \Customer \Api \CustomerRepositoryInterface ;
1314use Magento \Customer \Api \Data \CustomerInterface ;
2526use Magento \Quote \Api \Data \CartInterface ;
2627use Magento \Quote \Api \Data \CartItemInterface ;
2728use Magento \Quote \Api \Data \CartItemInterfaceFactory ;
29+ use Magento \Quote \Test \Fixture \AddProductToCart as AddProductToCartFixture ;
30+ use Magento \Quote \Test \Fixture \GuestCart as GuestCartFixture ;
31+ use Magento \TestFramework \Fixture \DataFixture ;
32+ use Magento \TestFramework \Fixture \DataFixtureStorage ;
33+ use Magento \TestFramework \Fixture \DataFixtureStorageManager ;
2834use Magento \TestFramework \Helper \Bootstrap ;
2935use Magento \TestFramework \Quote \Model \GetQuoteByReservedOrderId ;
3036use PHPUnit \Framework \TestCase ;
@@ -81,6 +87,11 @@ class QuoteTest extends TestCase
8187 /** @var ExtensibleDataObjectConverter */
8288 private $ extensibleDataObjectConverter ;
8389
90+ /**
91+ * @var DataFixtureStorage
92+ */
93+ private $ fixtures ;
94+
8495 /**
8596 * @inheritdoc
8697 */
@@ -102,6 +113,7 @@ protected function setUp(): void
102113 $ this ->customerResourceModel = $ this ->objectManager ->get (CustomerResourceModel::class);
103114 $ this ->groupFactory = $ this ->objectManager ->get (GroupFactory::class);
104115 $ this ->extensibleDataObjectConverter = $ this ->objectManager ->get (ExtensibleDataObjectConverter::class);
116+ $ this ->fixtures = $ this ->objectManager ->get (DataFixtureStorageManager::class)->getStorage ();
105117 }
106118
107119 /**
@@ -809,4 +821,23 @@ public function testIsMultiShippingModeEnabledAfterQuoteItemRemoved(): void
809821 );
810822 }
811823 }
824+
825+ #[
826+ DataFixture(ProductFixture::class, ['price ' => 922903400.00 ], as: 'product ' ),
827+ DataFixture(GuestCartFixture::class, as: 'cart ' ),
828+ DataFixture(
829+ AddProductToCartFixture::class,
830+ ['cart_id ' => '$cart.id$ ' , 'product_id ' => '$product.id$ ' , 'qty ' => 1 ]
831+ ),
832+ ]
833+ public function testQuoteItemWithPriceGreaterThan100Millions ()
834+ {
835+ $ product = $ this ->fixtures ->get ('product ' );
836+ $ cart = $ this ->fixtures ->get ('cart ' );
837+ $ item = $ cart ->getItemsCollection (false )->fetchItem ();
838+ $ this ->assertEquals (
839+ round ((float )$ product ->getPrice (), 2 ),
840+ round ((float )$ item ->getPrice (), 2 )
841+ );
842+ }
812843}
0 commit comments