@@ -98,13 +98,13 @@ public function testAddToCart(): void
9898 $ url = ShoppingCartController::add_item_link ($ this ->mp3player );
9999 $ httpResponse = $ this ->get ($ url );
100100
101- $ this ->assertEquals (200 , $ httpResponse ->getStatusCode (), "Adding the mp3 player should work " );
101+ $ this ->assertEquals (302 , $ httpResponse ->getStatusCode (), "Adding the mp3 player should work " );
102102
103103 $ secondMp3 = $ this ->get (ShoppingCartController::add_item_link ($ this ->mp3player ));
104- $ this ->assertEquals (200 , $ secondMp3 ->getStatusCode (), "Adding a second mp3 player should work " );
104+ $ this ->assertEquals (302 , $ secondMp3 ->getStatusCode (), "Adding a second mp3 player should work " );
105105
106106 $ socks = $ this ->get (ShoppingCartController::add_item_link ($ this ->socks ));
107- $ this ->assertEquals (200 , $ socks ->getStatusCode (), "Adding socks should work " );
107+ $ this ->assertEquals (302 , $ socks ->getStatusCode (), "Adding socks should work " );
108108
109109 // add a product that you can't add
110110 $ noPurchaseProduct = $ this ->get (ShoppingCartController::add_item_link ($ this ->noPurchaseProduct ));
@@ -220,7 +220,7 @@ public function testSecurityToken(): void
220220 $ this ->assertMatchesRegularExpression ('{^shoppingcart/add/SilverShop-Page-Product/ ' . $ productId . '\?SecurityID=[a-f0-9]+$} ' , $ link );
221221
222222 $ response = $ this ->get ($ link );
223- $ this ->assertEquals ($ response ->getStatusCode (), 200 );
223+ $ this ->assertEquals (302 , $ response ->getStatusCode ());
224224
225225 // disable security token for cart-links
226226 Config::modify ()->set (ShoppingCartController::class, 'disable_security_token ' , true );
@@ -229,7 +229,7 @@ public function testSecurityToken(): void
229229 $ this ->assertEquals ('shoppingcart/add/SilverShop-Page-Product/ ' . $ productId , $ link );
230230
231231 $ response = $ this ->get ($ link );
232- $ this ->assertEquals ($ response ->getStatusCode (), 200 );
232+ $ this ->assertEquals (302 , $ response ->getStatusCode ());
233233
234234 SecurityToken::disable ();
235235
@@ -238,12 +238,12 @@ public function testSecurityToken(): void
238238 $ this ->assertEquals ('shoppingcart/add/SilverShop-Page-Product/ ' . $ productId , $ link );
239239
240240 $ response = $ this ->get ($ link );
241- $ this ->assertEquals ($ response ->getStatusCode (), 200 );
241+ $ this ->assertEquals (302 , $ response ->getStatusCode ());
242242
243243 SecurityToken::enable ();
244244 // should now return a 400 status
245245 $ response = $ this ->get ($ link );
246- $ this ->assertEquals ($ response ->getStatusCode (), 400 );
246+ $ this ->assertEquals (400 , $ response ->getStatusCode ());
247247
248248 // restore previous setting
249249 if (!$ enabled ) {
0 commit comments