File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
dev/tests/integration/testsuite/Magento Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 16
16
17
17
$ coupon = $ couponFactory ->create ();
18
18
$ coupon ->loadByCode ('2?ds5!2d ' );
19
- $ yesterday = new \DateTime ();
20
- $ yesterday ->add (\DateInterval::createFromDateString ('-1 day ' ));
21
- $ coupon ->setExpirationDate ($ yesterday ->format ('Y-m-d ' ));
19
+ $ coupon ->setExpirationDate ('2016-08-06 ' );
22
20
$ couponResource ->save ($ coupon );
Original file line number Diff line number Diff line change 5
5
*/
6
6
declare (strict_types=1 );
7
7
8
+ use Magento \Framework \Exception \NoSuchEntityException ;
8
9
use Magento \Framework \Registry ;
9
10
use Magento \SalesRule \Api \RuleRepositoryInterface ;
10
11
use Magento \TestFramework \Helper \Bootstrap ;
19
20
$ ruleId = $ registry ->registry ('Magento/SalesRule/_files/cart_rule_100_percent_off ' );
20
21
21
22
if ($ ruleId ) {
22
- $ ruleRepository ->deleteById ($ ruleId );
23
+ try {
24
+ $ ruleRepository ->deleteById ($ ruleId );
25
+ // phpcs:ignore Magento2.CodeAnalysis.EmptyBlock
26
+ } catch (NoSuchEntityException $ e ) {
27
+ /**
28
+ * Tests which are wrapped with MySQL transaction clear all data by transaction rollback.
29
+ */
30
+ }
23
31
}
You can’t perform that action at this time.
0 commit comments