Skip to content

fix for Issue #25434 Mail address email constructor argument type inc… #25485

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
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
8 changes: 4 additions & 4 deletions lib/internal/Magento/Framework/Mail/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace Magento\Framework\Mail;

/**
* Class MailAddress
* Class Address
*/
class Address
{
Expand All @@ -23,7 +23,7 @@ class Address
private $email;

/**
* MailAddress constructor
* Address constructor
*
* @param string|null $email
* @param string|null $name
Expand All @@ -49,9 +49,9 @@ public function getName(): ?string
/**
* Email getter
*
* @return string
* @return string|null
*/
public function getEmail(): string
public function getEmail(): ?string
{
return $this->email;
}
Expand Down
31 changes: 31 additions & 0 deletions lib/internal/Magento/Framework/Mail/Test/Unit/AddressTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Framework\Mail\Test\Unit;

use Magento\Framework\Mail\Address;
use PHPUnit\Framework\TestCase;

/**
* test Magento\Framework\Mail\Address
*/
class AddressTest extends TestCase
{
/**
* @var Address
*/
protected $message;

/**
* Address object with nullable email parameter passed should not throw an exception.
*
* @return void
*/
public function testGetEmailEmpty()
{
$address = new Address(null, "Test name");
$this->assertNull($address->getEmail());
}
}