8
8
namespace Magento \Quote \Model ;
9
9
10
10
use Magento \Catalog \Api \ProductRepositoryInterface ;
11
+ use Magento \Catalog \Test \Fixture \Product as ProductFixture ;
11
12
use Magento \Checkout \Model \Session as CheckoutSession ;
12
13
use Magento \Customer \Api \CustomerRepositoryInterface ;
13
14
use Magento \Customer \Api \Data \CustomerInterface ;
25
26
use Magento \Quote \Api \Data \CartInterface ;
26
27
use Magento \Quote \Api \Data \CartItemInterface ;
27
28
use 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 ;
28
34
use Magento \TestFramework \Helper \Bootstrap ;
29
35
use Magento \TestFramework \Quote \Model \GetQuoteByReservedOrderId ;
30
36
use PHPUnit \Framework \TestCase ;
@@ -81,6 +87,11 @@ class QuoteTest extends TestCase
81
87
/** @var ExtensibleDataObjectConverter */
82
88
private $ extensibleDataObjectConverter ;
83
89
90
+ /**
91
+ * @var DataFixtureStorage
92
+ */
93
+ private $ fixtures ;
94
+
84
95
/**
85
96
* @inheritdoc
86
97
*/
@@ -102,6 +113,7 @@ protected function setUp(): void
102
113
$ this ->customerResourceModel = $ this ->objectManager ->get (CustomerResourceModel::class);
103
114
$ this ->groupFactory = $ this ->objectManager ->get (GroupFactory::class);
104
115
$ this ->extensibleDataObjectConverter = $ this ->objectManager ->get (ExtensibleDataObjectConverter::class);
116
+ $ this ->fixtures = $ this ->objectManager ->get (DataFixtureStorageManager::class)->getStorage ();
105
117
}
106
118
107
119
/**
@@ -809,4 +821,23 @@ public function testIsMultiShippingModeEnabledAfterQuoteItemRemoved(): void
809
821
);
810
822
}
811
823
}
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
+ }
812
843
}
0 commit comments