This repository was archived by the owner on May 20, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed
lib/internal/Magento/Framework/Webapi/Rest/Request Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ public function getOverriddenValue()
56
56
}
57
57
}
58
58
} catch (NoSuchEntityException $ e ) {
59
- /* do nothing and just return null */
59
+ throw new NoSuchEntityException ( __ ( ' Current customer does not have an active cart. ' ));
60
60
}
61
61
return null ;
62
62
}
Original file line number Diff line number Diff line change @@ -67,6 +67,9 @@ public function testGetOverriddenValueIsCustomerAndCartExists()
67
67
$ this ->assertSame ($ retValue , $ this ->model ->getOverriddenValue ());
68
68
}
69
69
70
+ /**
71
+ * @expectedException \Magento\Framework\Exception\NoSuchEntityException
72
+ */
70
73
public function testGetOverriddenValueIsCustomerAndCartDoesNotExist ()
71
74
{
72
75
$ customerId = 1 ;
@@ -83,7 +86,7 @@ public function testGetOverriddenValueIsCustomerAndCartDoesNotExist()
83
86
->with ($ customerId )
84
87
->will ($ this ->throwException (new NoSuchEntityException ()));
85
88
86
- $ this ->assertNull ( $ this -> model ->getOverriddenValue () );
89
+ $ this ->model ->getOverriddenValue ();
87
90
}
88
91
89
92
public function testGetOverriddenValueIsCustomerAndCartIsNull ()
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ interface ParamOverriderInterface
34
34
* Returns the overridden value to use.
35
35
*
36
36
* @return string|int|null
37
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
37
38
*/
38
39
public function getOverriddenValue ();
39
40
}
You can’t perform that action at this time.
0 commit comments