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

[pl_PL] Handle state. #1029

Merged
merged 1 commit into from
Sep 20, 2016
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: 5 additions & 0 deletions src/Faker/Provider/pl_PL/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,9 @@ public function streetName()
{
return static::randomElement(static::$street);
}

public function state()
{
return static::randomElement(static::$state);
}
}
31 changes: 31 additions & 0 deletions test/Faker/Provider/pl_PL/AddressTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace Faker\Provider\pl_PL;

use Faker\Generator;

class AddressTest extends \PHPUnit_Framework_TestCase
{
/**
* @var Generator
*/
private $faker;

public function setUp()
{
$faker = new Generator();
$faker->addProvider(new Address($faker));
$this->faker = $faker;
}

/**
* Test the validity of state
*/
public function testState()
{
$state = $this->faker->state();
$this->assertNotEmpty($state);
$this->assertInternalType('string', $state);
$this->assertRegExp('/[a-z]+/', $state);
}
}