Skip to content

magento/magento2#12719: Use full name in welcome message #12738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $welcomeMessage = $block->getWelcome();
case 'welcome': ?>
<li class="greet welcome" data-bind="scope: 'customer'">
<!-- ko if: customer().fullname -->
<span data-bind="text: new String('<?= $block->escapeHtml(__('Welcome, %1!', '%1')) ?>').replace('%1', customer().firstname)">
<span data-bind="text: new String('<?= $block->escapeHtml(__('Welcome, %1!', '%1')) ?>').replace('%1', customer().fullname)">
</span>
<!-- /ko -->
<!-- ko ifnot: customer().fullname -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ public function processAssert(
['customer' => $customer]
)->run();
\PHPUnit_Framework_Assert::assertEquals(
sprintf(self::WELCOME_MESSAGE, $customer->getFirstname()),
sprintf(
self::WELCOME_MESSAGE,
$customer->getFirstname() . ' ' . $customer->getLastname()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assertion may lead to false negative result in a future as full name has more complex logic then just first and last name (see \Magento\Customer\Helper\View::getCustomerName)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vkublytskyi You're right, but the fixtures are autogenerated - such complex logic is just not expected there.

),
$cmsIndex->getLinksBlock()->getWelcomeText(),
'Customer welcome message is wrong.'
);
Expand Down