FIX Member::getLastName() now correctly returns the Member surn… (#9226)

FIX Member::getLastName() now correctly returns the Member surname
This commit is contained in:
Guy Marriott 2019-09-07 09:12:50 +12:00 committed by GitHub
commit f788a8a927
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -1130,9 +1130,9 @@ class Member extends DataObject
*/
public function getLastName()
{
return $this->owner->Surname;
return $this->Surname;
}
/**
* Get the complete name of the member, by default in the format "<Surname>, <FirstName>".
* Falls back to showing either field on its own.

View File

@ -1585,4 +1585,12 @@ class MemberTest extends FunctionalTest
$result = $member->changePassword('Password123456789'); // 17 characters long
$this->assertTrue($result->isValid());
}
public function testGetLastName()
{
$member = new Member();
$member->Surname = 'Johnson';
$this->assertSame('Johnson', $member->getLastName(), 'getLastName should proxy to Surname');
}
}