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()
5656 }
5757 }
5858 } catch (NoSuchEntityException $ e ) {
59- /* do nothing and just return null */
59+ throw new NoSuchEntityException ( __ ( ' Current customer does not have an active cart. ' ));
6060 }
6161 return null ;
6262 }
Original file line number Diff line number Diff line change @@ -67,6 +67,9 @@ public function testGetOverriddenValueIsCustomerAndCartExists()
6767 $ this ->assertSame ($ retValue , $ this ->model ->getOverriddenValue ());
6868 }
6969
70+ /**
71+ * @expectedException \Magento\Framework\Exception\NoSuchEntityException
72+ */
7073 public function testGetOverriddenValueIsCustomerAndCartDoesNotExist ()
7174 {
7275 $ customerId = 1 ;
@@ -83,7 +86,7 @@ public function testGetOverriddenValueIsCustomerAndCartDoesNotExist()
8386 ->with ($ customerId )
8487 ->will ($ this ->throwException (new NoSuchEntityException ()));
8588
86- $ this ->assertNull ( $ this -> model ->getOverriddenValue () );
89+ $ this ->model ->getOverriddenValue ();
8790 }
8891
8992 public function testGetOverriddenValueIsCustomerAndCartIsNull ()
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ interface ParamOverriderInterface
3434 * Returns the overridden value to use.
3535 *
3636 * @return string|int|null
37+ * @throws \Magento\Framework\Exception\NoSuchEntityException
3738 */
3839 public function getOverriddenValue ();
3940}
You can’t perform that action at this time.
0 commit comments