Permalink
Browse files

Fix broken unit tests by b502129

Refs #97
  • Loading branch information...
1 parent 1b7f8bd commit a3ae3c9a4362f883d6a0cf76f72a5d5851cba2d3 @fzaninotto committed Jan 1, 2013
Showing with 13 additions and 5 deletions.
  1. +1 −1 src/Faker/Provider/fr_FR/Company.php
  2. +12 −4 test/Faker/Provider/fr_FR/CompanyTest.php
@@ -195,7 +195,7 @@ public static function siren()
/**
* @var array An array containing string which should not appear twice in a catch phrase.
*/
- private static $wordsWhichShouldNotAppearTwice = array('sécurité', 'simpl');
+ protected static $wordsWhichShouldNotAppearTwice = array('sécurité', 'simpl');
/**
* Validates a french catch phrase.
@@ -25,15 +25,15 @@ public function testParagraphWithNegativeNbDigitsReturnsAWellFormattedSiret()
{
$siret = Company::siret(-1);
- $this->assertThat($siret, self :: isValidSiret());
+ $this->assertThat($siret, self::isValidSiret());
$this->assertRegExp("/[\d]{3} [\d]{3} [\d]{3} 00[\d]{3}/", $siret);
}
public function testParagraphWithInvalidNbDigitsReturnsAWellFormattedSiret()
{
$siret = Company::siret(6);
- $this->assertThat($siret, self :: isValidSiret());
+ $this->assertThat($siret, self::isValidSiret());
$this->assertRegExp("/[\d]{3} [\d]{3} [\d]{3} 00[\d]{3}/", $siret);
}
@@ -64,15 +64,23 @@ public function testSirenReturnsAValidAndWellFormattedSiren()
public function testCatchPhraseValidationReturnsFalse()
{
- $isCatchPhraseValid = Company::isCatchPhraseValid('La sécurité de rouler en toute sécurité');
+ $isCatchPhraseValid = TestableCompany::isCatchPhraseValid('La sécurité de rouler en toute sécurité');
$this->assertFalse($isCatchPhraseValid);
}
public function testCatchPhraseValidationReturnsTrue()
{
- $isCatchPhraseValid = Company::isCatchPhraseValid('La sécurité de rouler en toute simplicité');
+ $isCatchPhraseValid = TestableCompany::isCatchPhraseValid('La sécurité de rouler en toute simplicité');
$this->assertTrue($isCatchPhraseValid);
}
}
+
+class TestableCompany extends Company
+{
+ public static function isCatchPhraseValid($catchPhrase)
+ {
+ return parent::isCatchPhraseValid($catchPhrase);
+ }
+}

0 comments on commit a3ae3c9

Please sign in to comment.