FIX Member::getLastName() now correctly returns the Member surname

This commit is contained in:
Robbie Averill 2019-09-06 12:12:27 -07:00
parent 66ca1c925f
commit e8c2f963fd
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');
}
}