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

Added male and female titles for the en_ZA locale #1321

Merged
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
5 changes: 4 additions & 1 deletion src/Faker/Provider/en_ZA/Person.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Faker\Provider\en_ZA;

use Faker\Calculator\Luhn;
use Faker\Provider\DateTime;

class Person extends \Faker\Provider\Person
{
Expand Down Expand Up @@ -127,6 +126,10 @@ class Person extends \Faker\Provider\Person
'Pule', 'Hlophe', 'Miya', 'Moagi',
);

protected static $titleMale = array('Mr.', 'Dr.', 'Prof.', 'Rev.', 'Hon.');

protected static $titleFemale = array('Mrs.', 'Ms.', 'Miss', 'Dr.', 'Prof.', 'Rev.', 'Hon.');

protected static $licenceCodes = array('A', 'A1', 'B', 'C', 'C1', 'C2', 'EB', 'EC', 'EC1', 'I', 'L', 'L1');

/**
Expand Down
14 changes: 14 additions & 0 deletions test/Faker/Provider/en_ZA/PersonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,18 @@ public function testLicenceCode()

$this->assertContains($this->faker->licenceCode, $validLicenceCodes);
}

public function testMaleTitles()
{
$validMaleTitles = array('Mr.', 'Dr.', 'Prof.', 'Rev.', 'Hon.');

$this->assertContains(Person::titleMale(), $validMaleTitles);
}

public function testFemaleTitles()
{
$validateFemaleTitles = array('Mrs.', 'Ms.', 'Miss', 'Dr.', 'Prof.', 'Rev.', 'Hon.');

$this->assertContains(Person::titleFemale(), $validateFemaleTitles);
}
}