19declare(strict_types=1);
24use PHPUnit\Framework\Attributes\DataProvider;
25use PHPUnit\Framework\TestCase;
35 $this->assertSame(
'poll_population [0]',
PluralFormKey::of(
'poll_population', 0));
36 $this->assertSame(
'poll_population [1]',
PluralFormKey::of(
'poll_population', 1));
39 #[DataProvider('roundTripKeys')]
51 'simple' => [
'poll_population', 0],
52 'two digit form' => [
'poll_population', 10],
53 'identifier containing brackets' => [
'weird [legacy]', 1],
54 'identifier containing a space' => [
'poll population', 1],
58 #[DataProvider('nonFormKeys')]
70 'plain identifier' => [
'poll_population'],
71 'no space before bracket' => [
'poll_population[0]'],
72 'no closing bracket' => [
'poll_population [0'],
73 'non-numeric form' => [
'poll_population [x]'],
74 'leading zero form' => [
'poll_population [01]'],
75 'negative form' => [
'poll_population [-1]'],
76 'empty identifier' => [
' [0]'],
77 'empty string' => [
''],
78 'trailing characters after bracket' => [
'poll_population [0] extra'],