|
3 | 3 | * Copyright © Magento, Inc. All rights reserved.
|
4 | 4 | * See COPYING.txt for license details.
|
5 | 5 | */
|
| 6 | +declare(strict_types=1); |
| 7 | + |
6 | 8 | namespace Magento\User\Controller\Adminhtml;
|
7 | 9 |
|
8 | 10 | use Magento\Framework\Exception\LocalizedException;
|
9 | 11 | use Magento\Framework\Mail\EmailMessage;
|
| 12 | +use Magento\Store\Model\Store; |
10 | 13 | use Magento\TestFramework\Fixture\Config as Config;
|
11 | 14 | use Magento\TestFramework\Fixture\DataFixture;
|
12 | 15 | use Magento\TestFramework\Fixture\DataFixtureStorage;
|
@@ -63,11 +66,12 @@ public function testUserResetPasswordEmail()
|
63 | 66 |
|
64 | 67 | private function getResetPasswordUri(EmailMessage $message): string
|
65 | 68 | {
|
| 69 | + $store = $this->_objectManager->get(Store::class); |
66 | 70 | $emailParts = $message->getBody()->getParts();
|
67 | 71 | $messageContent = current($emailParts)->getRawContent();
|
68 | 72 | $pattern = '#\bhttps?://[^,\s()<>]+(?:\([\w\d]+\)|([^,[:punct:]\s]|/))#';
|
69 | 73 | preg_match_all($pattern, $messageContent, $match);
|
70 |
| - $urlString = strstr($match[0][0], 'backend'); |
| 74 | + $urlString = trim($match[0][0], $store->getBaseUrl('web')); |
71 | 75 | return substr($urlString, 0, strpos($urlString, "/key"));
|
72 | 76 | }
|
73 | 77 | }
|
0 commit comments