Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Commit

Permalink
Merge pull request #2045 from sanmon1985/patch-1
Browse files Browse the repository at this point in the history
Fix letter 'a' in female lastname generation (ru_RU)
  • Loading branch information
localheinz authored Oct 23, 2020
2 parents 0ce5bd6 + 3a572e3 commit c2b0253
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Faker/Provider/ru_RU/Person.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class Person extends \Faker\Provider\Person
'Меркушев', 'Лыткин', 'Туров',
);

protected static $lastNameSuffix = array('a', '');
protected static $lastNameSuffix = array('а', '');

/**
* Return male middle name
Expand Down Expand Up @@ -169,7 +169,7 @@ public function lastName($gender = null)
$lastName = static::randomElement(static::$lastName);

if (static::GENDER_FEMALE === $gender) {
return $lastName . 'a';
return $lastName . 'а';
} elseif (static::GENDER_MALE === $gender) {
return $lastName;
}
Expand Down
4 changes: 2 additions & 2 deletions test/Faker/Provider/ru_RU/PersonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ protected function setUp()

public function testLastNameFemale()
{
$this->assertEquals("a", substr($this->faker->lastName('female'), -1));
$this->assertEquals("а", substr($this->faker->lastName('female'), -2, 2));
}

public function testLastNameMale()
{
$this->assertNotEquals("a", substr($this->faker->lastName('male'), -1));
$this->assertNotEquals("а", substr($this->faker->lastName('male'), -2, 2));
}

public function testLastNameRandom()
Expand Down

0 comments on commit c2b0253

Please # to comment.