|
16 | 16 | use CodeIgniter\Database\RawSql; |
17 | 17 | use CodeIgniter\Test\CIUnitTestCase; |
18 | 18 | use CodeIgniter\Test\DatabaseTestTrait; |
| 19 | +use PHPUnit\Framework\Attributes\DataProvider; |
19 | 20 | use PHPUnit\Framework\Attributes\Group; |
20 | 21 | use Tests\Support\Database\Seeds\CITestSeeder; |
21 | 22 |
|
@@ -75,6 +76,29 @@ public function testLikeCaseInsensitive(): void |
75 | 76 | $this->assertSame('Developer', $job->name); |
76 | 77 | } |
77 | 78 |
|
| 79 | + #[DataProvider('provideMultibyteCharacters')] |
| 80 | + public function testLikeCaseInsensitiveWithMultibyteCharacter(string $match, string $result): void |
| 81 | + { |
| 82 | + $wai = $this->db->table('without_auto_increment')->like('value', $match, 'both', null, true)->get(); |
| 83 | + $wai = $wai->getRow(); |
| 84 | + |
| 85 | + $this->assertSame($result, $wai->key); |
| 86 | + } |
| 87 | + |
| 88 | + /** |
| 89 | + * @return iterable<string, array{0: string, 1: string}> |
| 90 | + */ |
| 91 | + public static function provideMultibyteCharacters(): iterable |
| 92 | + { |
| 93 | + yield from [ |
| 94 | + 'polish' => ['ŁĄ', 'multibyte characters pl'], |
| 95 | + 'farsi' => ['خٌوب', 'multibyte characters fa'], |
| 96 | + 'bengali' => ['টাইপ', 'multibyte characters bn'], |
| 97 | + 'korean' => ['캐스팅', 'multibyte characters ko'], |
| 98 | + 'malayalam' => ['ടൈപ്പ്', 'multibyte characters ml'], |
| 99 | + ]; |
| 100 | + } |
| 101 | + |
78 | 102 | public function testOrLike(): void |
79 | 103 | { |
80 | 104 | $jobs = $this->db->table('job')->like('name', 'ian') |
|
0 commit comments