44namespace Tests \I18n \Unit \Tools ;
55
66use amcsi \LyceeOverture \I18n \Tools \JapaneseSentenceSplitter ;
7+ use PHPUnit \Framework \Attributes \DataProvider ;
78use PHPUnit \Framework \TestCase ;
89
910class JapaneseSentenceSplitterTest extends TestCase
1011{
1112
12- /**
13- * @dataProvider provideReplace
14- */
13+ #[DataProvider('provideReplace ' )]
1514 public function testReplaceCallback (string $ expected , string $ input )
1615 {
17- self ::assertSame ($ expected , JapaneseSentenceSplitter::replaceCallback ($ input , static fn ($ match ) => $ match [0 ] . '¤ ' ));
16+ self ::assertSame ($ expected ,
17+ JapaneseSentenceSplitter::replaceCallback ($ input , static fn ($ match ) => $ match [0 ].'¤ ' ));
1818 }
1919
2020 public static function provideReplace ()
@@ -23,7 +23,7 @@ public static function provideReplace()
2323 'simple ' => ['hey¤ ' , 'hey ' ],
2424 'line break ' => ["hey \n¤yo¤ " , "hey \nyo " ],
2525 'periods ' => ["る。¤yo¤ " , "る。yo " ],
26- 'period and line break ' => ["る。¤ \n¤ " , "る。 \n" ],
26+ 'period and line break ' => ["る。¤ \n¤ " , "る。 \n" ],
2727 'periods and line breaks ' => ["る。¤ \n¤き。¤ \n¤ " , "る。 \nき。 \n" ],
2828 'periods in brackets ' => ["[ペナルティ:[1枚ドローする。]]。¤る。¤ " , "[ペナルティ:[1枚ドローする。]]。る。 " ],
2929 ];
0 commit comments