Skip to content

Commit 8920923

Browse files
david-fuehrhostep
authored andcommitted
refactor original change to implement better code style
1 parent bd96456 commit 8920923

File tree

2 files changed

+60
-3
lines changed

2 files changed

+60
-3
lines changed

app/code/Magento/Checkout/Model/Session.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,10 @@ public function getQuote()
283283
$customerId = $this->_customer
284284
? $this->_customer->getId()
285285
: $this->_customerSession->getCustomerId();
286-
try {
287-
$quote = $this->quoteRepository->getActiveForCustomer($customerId);
286+
287+
$quote = $this->quoteRepository->getForCustomer($customerId);
288+
if ($quote->getIsActive()) {
288289
$this->setQuoteId($quote->getId());
289-
} catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
290290
}
291291
} else {
292292
$quote->setIsCheckoutCart(true);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<alr:test-suite xmlns:alr="urn:model.allure.qatools.yandex.ru" start="1564567171867" stop="1564567171982" version="1.4.0">
3+
<name>Magento\Checkout\Test\Unit\Model\SessionTest</name>
4+
<test-cases>
5+
<test-case start="1564567171869" stop="1564567171914" status="passed">
6+
<name>testGetLastRealOrder with data set #0</name>
7+
</test-case>
8+
<test-case start="1564567171915" stop="1564567171916" status="passed">
9+
<name>testGetLastRealOrder with data set #1</name>
10+
</test-case>
11+
<test-case start="1564567171916" stop="1564567171917" status="passed">
12+
<name>testGetLastRealOrder with data set #2</name>
13+
</test-case>
14+
<test-case start="1564567171918" stop="1564567171920" status="passed">
15+
<name>testClearHelperData with data set #0</name>
16+
</test-case>
17+
<test-case start="1564567171920" stop="1564567171922" status="passed">
18+
<name>testClearHelperData with data set #1</name>
19+
</test-case>
20+
<test-case start="1564567171922" stop="1564567171922" status="passed">
21+
<name>testClearHelperData with data set #2</name>
22+
</test-case>
23+
<test-case start="1564567171922" stop="1564567171923" status="passed">
24+
<name>testClearHelperData with data set #3</name>
25+
</test-case>
26+
<test-case start="1564567171923" stop="1564567171948" status="passed">
27+
<name>testRestoreQuote with data set #0</name>
28+
</test-case>
29+
<test-case start="1564567171949" stop="1564567171953" status="passed">
30+
<name>testRestoreQuote with data set #1</name>
31+
</test-case>
32+
<test-case start="1564567171954" stop="1564567171955" status="passed">
33+
<name>testRestoreQuote with data set #2</name>
34+
</test-case>
35+
<test-case start="1564567171955" stop="1564567171956" status="passed">
36+
<name>testRestoreQuote with data set #3</name>
37+
</test-case>
38+
<test-case start="1564567171956" stop="1564567171970" status="passed">
39+
<name>testHasQuote</name>
40+
</test-case>
41+
<test-case start="1564567171970" stop="1564567171973" status="passed">
42+
<name>testReplaceQuote</name>
43+
</test-case>
44+
<test-case start="1564567171973" stop="1564567171975" status="passed">
45+
<name>testClearStorage</name>
46+
</test-case>
47+
<test-case start="1564567171975" stop="1564567171977" status="passed">
48+
<name>testResetCheckout</name>
49+
</test-case>
50+
<test-case start="1564567171977" stop="1564567171978" status="passed">
51+
<name>testGetStepData</name>
52+
</test-case>
53+
<test-case start="1564567171978" stop="1564567171980" status="passed">
54+
<name>testSetStepData</name>
55+
</test-case>
56+
</test-cases>
57+
</alr:test-suite>

0 commit comments

Comments
 (0)