fzaninotto / Faker

Faker is a PHP library that generates fake data for you
MIT License
26.79k stars 3.56k forks source link

ru_RU #1804

Open dotus-ru opened 4 years ago

dotus-ru commented 4 years ago

Summary

Wrong ru_RU locale street name ($faker->streetName) generation, plus $faker->streetSuffix return only 'Street'

Versions

Version
PHP 7.2.10
fzaninotto/faker 1.8.0

Self-enclosed code snippet for reproduction

$faker->streetName

Expected output

пер. Ленина
шоссе Чехова
ул. Ленина

Actual output

Денисов Street
Русаков Street
Филатов Street

Solution: in ru_RU/Address.php add

    protected static $streetNameFormats = array(
        '{{streetPrefix}} {{street}}'
    );

    public function streetName()
    {
        $format = static::randomElement(static::$streetNameFormats);

        return $this->generator->parse($format);
    }
kingofnull commented 4 years ago

How should I write the test case is there any example or guide?