@@ -36,7 +36,7 @@ class SaveTest extends AbstractBackendController
3636 *
3737 * @var string
3838 */
39- private $ _baseControllerUrl = 'http://localhost/index.php/ backend/customer/index/ ' ;
39+ private $ baseControllerUrl = 'backend/customer/index/ ' ;
4040
4141 /** @var CustomerRepositoryInterface */
4242 private $ customerRepository ;
@@ -83,7 +83,7 @@ public function testCreateCustomer(array $postData, array $expectedData): void
8383 $ this ->equalTo ([(string )__ ('You saved the customer. ' )]),
8484 MessageInterface::TYPE_SUCCESS
8585 );
86- $ this ->assertRedirect ($ this ->stringStartsWith ($ this ->_baseControllerUrl . 'index/key/ ' ));
86+ $ this ->assertRedirect ($ this ->stringContains ($ this ->baseControllerUrl . 'index/key/ ' ));
8787 $ this ->assertCustomerData (
8888 $ postData ['customer ' ][CustomerData::EMAIL ],
8989 (int )$ postData ['customer ' ][CustomerData::WEBSITE_ID ],
@@ -158,7 +158,7 @@ public function testCreateCustomerErrors(array $postData, array $expectedData, a
158158 );
159159 $ this ->assertNotEmpty ($ this ->session ->getCustomerFormData ());
160160 $ this ->assertArraySubset ($ expectedData , $ this ->session ->getCustomerFormData ());
161- $ this ->assertRedirect ($ this ->stringStartsWith ($ this ->_baseControllerUrl . 'new/key/ ' ));
161+ $ this ->assertRedirect ($ this ->stringContains ($ this ->baseControllerUrl . 'new/key/ ' ));
162162 }
163163
164164 /**
@@ -251,8 +251,8 @@ public function testUpdateCustomer(): void
251251 $ this ->equalTo ([(string )__ ('You saved the customer. ' )]),
252252 MessageInterface::TYPE_SUCCESS
253253 );
254- $ this ->assertRedirect ($ this ->stringStartsWith (
255- $ this ->_baseControllerUrl . 'edit/id/ ' . $ customerData ->getId ()
254+ $ this ->assertRedirect ($ this ->stringContains (
255+ $ this ->baseControllerUrl . 'edit/id/ ' . $ customerData ->getId ()
256256 ));
257257 $ this ->assertCustomerData ($ customerData ->getEmail (), (int )$ customerData ->getWebsiteId (), $ expectedData );
258258 $ this ->assertCustomerSubscription (
@@ -289,7 +289,7 @@ public function testExistingCustomerUnsubscribeNewsletter(): void
289289 $ this ->equalTo ([(string )__ ('You saved the customer. ' )]),
290290 MessageInterface::TYPE_SUCCESS
291291 );
292- $ this ->assertRedirect ($ this ->stringStartsWith ($ this ->_baseControllerUrl . 'index/key/ ' ));
292+ $ this ->assertRedirect ($ this ->stringContains ($ this ->baseControllerUrl . 'index/key/ ' ));
293293 $ this ->assertCustomerSubscription (
294294 (int )$ customerData ->getId (),
295295 (int )$ customerData ->getWebsiteId (),
@@ -344,7 +344,7 @@ public function testExistingCustomerChangeEmail(): void
344344 * Check that no errors were generated and set to session
345345 */
346346 $ this ->assertSessionMessages ($ this ->isEmpty (), MessageInterface::TYPE_ERROR );
347- $ this ->assertRedirect ($ this ->stringStartsWith ($ this ->_baseControllerUrl . 'index/key/ ' ));
347+ $ this ->assertRedirect ($ this ->stringContains ($ this ->baseControllerUrl . 'index/key/ ' ));
348348 }
349349
350350 /**
@@ -384,7 +384,7 @@ public function testCreateSameEmailFormatDateError(): void
384384 true ,
385385 'Customer form data should be formatted '
386386 );
387- $ this ->assertRedirect ($ this ->stringStartsWith ($ this ->_baseControllerUrl . 'new/key/ ' ));
387+ $ this ->assertRedirect ($ this ->stringContains ($ this ->baseControllerUrl . 'new/key/ ' ));
388388 }
389389
390390 /**
@@ -449,7 +449,7 @@ private function dispatchCustomerSave(array $postData, array $params = []): void
449449 if (!empty ($ params )) {
450450 $ this ->getRequest ()->setParams ($ params );
451451 }
452- $ this ->dispatch (' backend/customer/index/ save ' );
452+ $ this ->dispatch ($ this -> baseControllerUrl . ' save ' );
453453 }
454454
455455 /**
0 commit comments