@@ -36,7 +36,7 @@ class SaveTest extends AbstractBackendController
36
36
*
37
37
* @var string
38
38
*/
39
- private $ _baseControllerUrl = 'http://localhost/index.php/ backend/customer/index/ ' ;
39
+ private $ baseControllerUrl = 'backend/customer/index/ ' ;
40
40
41
41
/** @var CustomerRepositoryInterface */
42
42
private $ customerRepository ;
@@ -83,7 +83,7 @@ public function testCreateCustomer(array $postData, array $expectedData): void
83
83
$ this ->equalTo ([(string )__ ('You saved the customer. ' )]),
84
84
MessageInterface::TYPE_SUCCESS
85
85
);
86
- $ this ->assertRedirect ($ this ->stringStartsWith ($ this ->_baseControllerUrl . 'index/key/ ' ));
86
+ $ this ->assertRedirect ($ this ->stringContains ($ this ->baseControllerUrl . 'index/key/ ' ));
87
87
$ this ->assertCustomerData (
88
88
$ postData ['customer ' ][CustomerData::EMAIL ],
89
89
(int )$ postData ['customer ' ][CustomerData::WEBSITE_ID ],
@@ -158,7 +158,7 @@ public function testCreateCustomerErrors(array $postData, array $expectedData, a
158
158
);
159
159
$ this ->assertNotEmpty ($ this ->session ->getCustomerFormData ());
160
160
$ this ->assertArraySubset ($ expectedData , $ this ->session ->getCustomerFormData ());
161
- $ this ->assertRedirect ($ this ->stringStartsWith ($ this ->_baseControllerUrl . 'new/key/ ' ));
161
+ $ this ->assertRedirect ($ this ->stringContains ($ this ->baseControllerUrl . 'new/key/ ' ));
162
162
}
163
163
164
164
/**
@@ -251,8 +251,8 @@ public function testUpdateCustomer(): void
251
251
$ this ->equalTo ([(string )__ ('You saved the customer. ' )]),
252
252
MessageInterface::TYPE_SUCCESS
253
253
);
254
- $ this ->assertRedirect ($ this ->stringStartsWith (
255
- $ this ->_baseControllerUrl . 'edit/id/ ' . $ customerData ->getId ()
254
+ $ this ->assertRedirect ($ this ->stringContains (
255
+ $ this ->baseControllerUrl . 'edit/id/ ' . $ customerData ->getId ()
256
256
));
257
257
$ this ->assertCustomerData ($ customerData ->getEmail (), (int )$ customerData ->getWebsiteId (), $ expectedData );
258
258
$ this ->assertCustomerSubscription (
@@ -289,7 +289,7 @@ public function testExistingCustomerUnsubscribeNewsletter(): void
289
289
$ this ->equalTo ([(string )__ ('You saved the customer. ' )]),
290
290
MessageInterface::TYPE_SUCCESS
291
291
);
292
- $ this ->assertRedirect ($ this ->stringStartsWith ($ this ->_baseControllerUrl . 'index/key/ ' ));
292
+ $ this ->assertRedirect ($ this ->stringContains ($ this ->baseControllerUrl . 'index/key/ ' ));
293
293
$ this ->assertCustomerSubscription (
294
294
(int )$ customerData ->getId (),
295
295
(int )$ customerData ->getWebsiteId (),
@@ -344,7 +344,7 @@ public function testExistingCustomerChangeEmail(): void
344
344
* Check that no errors were generated and set to session
345
345
*/
346
346
$ 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/ ' ));
348
348
}
349
349
350
350
/**
@@ -384,7 +384,7 @@ public function testCreateSameEmailFormatDateError(): void
384
384
true ,
385
385
'Customer form data should be formatted '
386
386
);
387
- $ this ->assertRedirect ($ this ->stringStartsWith ($ this ->_baseControllerUrl . 'new/key/ ' ));
387
+ $ this ->assertRedirect ($ this ->stringContains ($ this ->baseControllerUrl . 'new/key/ ' ));
388
388
}
389
389
390
390
/**
@@ -449,7 +449,7 @@ private function dispatchCustomerSave(array $postData, array $params = []): void
449
449
if (!empty ($ params )) {
450
450
$ this ->getRequest ()->setParams ($ params );
451
451
}
452
- $ this ->dispatch (' backend/customer/index/ save ' );
452
+ $ this ->dispatch ($ this -> baseControllerUrl . ' save ' );
453
453
}
454
454
455
455
/**
0 commit comments