1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
<?php
namespace Faker\Test\Provider\en_ZA;
use Faker\Provider\en_ZA\Company;
use Faker\Test\TestCase;
/**
* @group legacy
*/
final class CompanyTest extends TestCase
{
public function testGenerateValidCompanyNumber()
{
$companyRegNo = $this->faker->companyNumber();
self::assertEquals(14, strlen($companyRegNo));
self::assertMatchesRegularExpression('#^\d{4}/\d{6}/\d{2}$#', $companyRegNo);
}
protected function getProviders(): iterable
{
yield new Company($this->faker);
}
}
|