@@ -67,6 +67,7 @@ public function testGetSelectCountSql()
67
67
68
68
public function testPrepareActiveCartItems ()
69
69
{
70
+ static $ i = 0 ;
70
71
/** @var MockObject $collection */
71
72
$ constructArgs = $ this ->objectManager
72
73
->getConstructArguments (QuoteItemCollection::class);
@@ -79,7 +80,25 @@ public function testPrepareActiveCartItems()
79
80
$ collection ->expects ($ this ->exactly (2 ))->method ('getSelect ' )->willReturn ($ this ->selectMock );
80
81
$ this ->selectMock ->expects ($ this ->once ())->method ('reset ' )->willReturnSelf ();
81
82
$ this ->selectMock ->expects ($ this ->once ())->method ('from ' )->willReturnSelf ();
82
- $ this ->selectMock ->expects ($ this ->atLeastOnce ())->method ('columns ' )->willReturnSelf ();
83
+ $ this ->selectMock ->expects ($ this ->atLeastOnce ())->method ('columns ' )
84
+ ->with (self ::callback (function ($ columns ) use (&$ i ) {
85
+ switch ($ i ) {
86
+ case 0 :
87
+ $ this ->assertContains ('main_table.product_id ' , $ columns );
88
+ $ this ->assertContains ('main_table.name ' , $ columns );
89
+ $ this ->assertContains ('main_table.price ' , $ columns );
90
+ $ i ++;
91
+ break ;
92
+ case 1 :
93
+ $ this ->assertEquals (['carts ' => new \Zend_Db_Expr ('COUNT(main_table.item_id) ' )], $ columns );
94
+ $ i ++;
95
+ break ;
96
+ case 2 :
97
+ $ this ->assertEquals ('quote.base_to_global_rate ' , $ columns );
98
+ $ i ++;
99
+ }
100
+ return true ;
101
+ }))->willReturnSelf ();
83
102
$ this ->selectMock ->expects ($ this ->once ())->method ('joinInner ' )->willReturnSelf ();
84
103
$ this ->selectMock ->expects ($ this ->once ())->method ('where ' )->willReturnSelf ();
85
104
$ this ->selectMock ->expects ($ this ->once ())->method ('group ' )->willReturnSelf ();
0 commit comments