Skip to content

Commit

Permalink
Added male and female titles for the en_ZA locale
Browse files Browse the repository at this point in the history
- The new titles are for Revenant (Rev.) and Honourable (Hon.)
- Remove unused use import for Faker\Provider\DateTime
  • Loading branch information
Le-Roux Enslin committed Oct 13, 2017
1 parent 62ee2d8 commit b764b25
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
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);
}
}

0 comments on commit b764b25

Please sign in to comment.