Skip to content

Commit 4dba230

Browse files
lakshmanadevarul
authored andcommitted
ACP2E-1446 : fixed issue in test coverage
1 parent ac3a859 commit 4dba230

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

dev/tests/integration/testsuite/Magento/User/Controller/Adminhtml/UserResetPasswordEmailTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\User\Controller\Adminhtml;
79

810
use Magento\Framework\Exception\LocalizedException;
911
use Magento\Framework\Mail\EmailMessage;
12+
use Magento\Store\Model\Store;
1013
use Magento\TestFramework\Fixture\Config as Config;
1114
use Magento\TestFramework\Fixture\DataFixture;
1215
use Magento\TestFramework\Fixture\DataFixtureStorage;
@@ -63,11 +66,12 @@ public function testUserResetPasswordEmail()
6366

6467
private function getResetPasswordUri(EmailMessage $message): string
6568
{
69+
$store = $this->_objectManager->get(Store::class);
6670
$emailParts = $message->getBody()->getParts();
6771
$messageContent = current($emailParts)->getRawContent();
6872
$pattern = '#\bhttps?://[^,\s()<>]+(?:\([\w\d]+\)|([^,[:punct:]\s]|/))#';
6973
preg_match_all($pattern, $messageContent, $match);
70-
$urlString = strstr($match[0][0], 'backend');
74+
$urlString = trim($match[0][0], $store->getBaseUrl('web'));
7175
return substr($urlString, 0, strpos($urlString, "/key"));
7276
}
7377
}

0 commit comments

Comments
 (0)