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 #1321 from ViGouRCanberra/feature/add-za-local-titles
Browse files Browse the repository at this point in the history
Added male and female titles for the en_ZA locale
  • Loading branch information
fzaninotto authored Oct 16, 2017
2 parents 62ee2d8 + b764b25 commit 1e898a8
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 1e898a8

Please sign in to comment.