File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
dev/tests/integration/testsuite/Magento/Sales Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -53,10 +53,14 @@ protected function setUp()
53
53
*/
54
54
public function testExecute ()
55
55
{
56
- $ this ->cleanExpiredQuotes ->execute ();
57
56
$ searchCriteria = $ this ->searchCriteriaBuilder ->create ();
58
- $ totalCount = $ this ->quoteRepository ->getList ($ searchCriteria )->getTotalCount ();
57
+ //Initial count - should be equal to stores number.
58
+ $ this ->assertEquals (2 , $ this ->quoteRepository ->getList ($ searchCriteria )->getTotalCount ());
59
59
60
+ //Deleting expired quotes
61
+ $ this ->cleanExpiredQuotes ->execute ();
62
+ $ totalCount = $ this ->quoteRepository ->getList ($ searchCriteria )->getTotalCount ();
63
+ //Only 1 will be deleted for the store that has all of them expired by config (default_store)
60
64
$ this ->assertEquals (
61
65
1 ,
62
66
$ totalCount
Original file line number Diff line number Diff line change 7
7
8
8
use Magento \Quote \Model \QuoteFactory ;
9
9
use Magento \Quote \Model \QuoteRepository ;
10
+ use Magento \Store \Model \Store ;
11
+ use Magento \Store \Model \StoreFactory ;
10
12
use Magento \TestFramework \Helper \Bootstrap ;
11
13
use Magento \TestFramework \ObjectManager ;
12
14
13
- require dirname ( dirname ( __DIR__ )) . '/Store/_files/second_store.php ' ;
15
+ require __DIR__ . '/../.. /Store/_files/second_store.php ' ;
14
16
15
17
/** @var $objectManager ObjectManager */
16
18
$ objectManager = Bootstrap::getObjectManager ();
17
19
/** @var QuoteFactory $quoteFactory */
18
20
$ quoteFactory = $ objectManager ->get (QuoteFactory::class);
19
21
/** @var QuoteRepository $quoteRepository */
20
22
$ quoteRepository = $ objectManager ->get (QuoteRepository::class);
23
+ /** @var StoreFactory $storeFactory */
24
+ $ storeFactory = $ objectManager ->get (StoreFactory::class);
25
+ /** @var Store $secondStore */
26
+ $ secondStore = $ storeFactory ->create ();
27
+ $ secondStore ->load ('fixture_second_store ' , 'code ' );
21
28
22
29
$ quotes = [
23
30
'quote for first store ' => [
24
31
'store ' => 1 ,
25
32
],
26
33
'quote for second store ' => [
27
- 'store ' => 2 ,
34
+ 'store ' => $ secondStore -> getId () ,
28
35
],
29
36
];
30
37
You can’t perform that action at this time.
0 commit comments