Skip to content

Commit

Permalink
dataprovider to attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
asika32764 committed Dec 6, 2024
1 parent 2ced6f0 commit f7d5888
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions test/ArrayObjectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ public function testConstruct(): void
*
* @return void
*
* @dataProvider providerTestColumn
*/
#[\PHPUnit\Framework\Attributes\DataProvider('providerTestColumn')]
public function testColumn(array $src, $column, array $except, string $message): void
{
self::assertEquals($except, arr($src)->column($column)->dump(), $message);
Expand Down Expand Up @@ -408,8 +408,8 @@ public function testValues(): void
*
* @return void
*
* @dataProvider providerTestSearch
*/
#[\PHPUnit\Framework\Attributes\DataProvider('providerTestSearch')]
public function testSearch($exp, $search, bool $strict): void
{
$a = arr([1, 2, 3, true, false, '', 0, null]);
Expand Down
44 changes: 22 additions & 22 deletions test/StringObjectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ public function testCallProxy()
* @param string $expected
* @param int $offset
*
* @dataProvider offsetGetProvider
*/
#[\PHPUnit\Framework\Attributes\DataProvider('offsetGetProvider')]
public function testOffsetGet(int $offset, string $expected)
{
$s = new StringObject('白日依山盡');
Expand Down Expand Up @@ -166,8 +166,8 @@ public static function offsetGetProvider(): array
*
* @return void
*
* @dataProvider offsetSetProvider
*/
#[\PHPUnit\Framework\Attributes\DataProvider('offsetSetProvider')]
public function testOffsetSet(string $string, string $replace, int $offset, string $expected)
{
$s = new StringObject($string);
Expand Down Expand Up @@ -200,8 +200,8 @@ public static function offsetSetProvider(): array
*
* @return void
*
* @dataProvider offsetUnsetProvider
*/
#[\PHPUnit\Framework\Attributes\DataProvider('offsetUnsetProvider')]
public function testOffsetUnset(string $string, int $offset, string $expected)
{
$s = new StringObject($string);
Expand Down Expand Up @@ -283,8 +283,8 @@ public function testGetIterator()
*
* @return void
*
* @dataProvider toLowerCaseProvider
*/
#[\PHPUnit\Framework\Attributes\DataProvider('toLowerCaseProvider')]
public function testToLowerCase(string $string, string $expected)
{
$s = new StringObject($string);
Expand Down Expand Up @@ -317,8 +317,8 @@ public static function toLowerCaseProvider(): array
*
* @return void
*
* @dataProvider toUpperCaseProvider
*/
#[\PHPUnit\Framework\Attributes\DataProvider('toUpperCaseProvider')]
public function testToUpperCase(string $string, string $expected)
{
$s = new StringObject($string);
Expand Down Expand Up @@ -352,8 +352,8 @@ public static function toUpperCaseProvider(): array
*
* @return void
*
* @dataProvider lengthProvider
*/
#[\PHPUnit\Framework\Attributes\DataProvider('lengthProvider')]
public function testLength(string $string, int $expected, ?string $encoding = null)
{
$s = new StringObject($string, $encoding);
Expand Down Expand Up @@ -393,8 +393,8 @@ public static function lengthProvider(): array
*
* @return void
*
* @dataProvider replaceProvider
*/
#[\PHPUnit\Framework\Attributes\DataProvider('replaceProvider')]
public function testReplace(string $string, $search, $replacement, $expected, int $count)
{
$s = new StringObject($string);
Expand Down Expand Up @@ -442,8 +442,8 @@ public static function replaceProvider(): array
* @param int $length
* @param array $expected
*
* @dataProvider strSplitProvider
*/
#[\PHPUnit\Framework\Attributes\DataProvider('strSplitProvider')]
public function testChop(string $string, int $length, $expected)
{
$s = new StringObject($string);
Expand All @@ -462,8 +462,8 @@ public function testChop(string $string, int $length, $expected)
* @param string $str2
* @param int $expected
*
* @dataProvider strcmpProvider
*/
#[\PHPUnit\Framework\Attributes\DataProvider('strcmpProvider')]
public function testCompare(string $str1, string $str2, int $expected)
{
$s = new StringObject($str1);
Expand All @@ -484,8 +484,8 @@ public function testCompare(string $str1, string $str2, int $expected)
* @param string $str2
* @param int $expected
*
* @dataProvider strcasecmpProvider
*/
#[\PHPUnit\Framework\Attributes\DataProvider('strcasecmpProvider')]
public function testCompareInsensitive(string $str1, string $str2, int $expected)
{
$s = new StringObject($str1);
Expand All @@ -505,8 +505,8 @@ public function testCompareInsensitive(string $str1, string $str2, int $expected
* @param string $string
* @param string $expected
*
* @dataProvider strrevProvider
*/
#[\PHPUnit\Framework\Attributes\DataProvider('strrevProvider')]
public function testReverse(string $string, string $expected)
{
$s = new StringObject($string);
Expand All @@ -526,8 +526,8 @@ public function testReverse(string $string, string $expected)
* @param int $start
* @param int $offset
*
* @dataProvider substrReplaceProvider
*/
#[\PHPUnit\Framework\Attributes\DataProvider('substrReplaceProvider')]
public function testSubstrReplace(
string $expected,
$string,
Expand Down Expand Up @@ -556,8 +556,8 @@ public function testSubstrReplace(
* @param null|string $charlist
* @param string $expected
*
* @dataProvider ltrimProvider
*/
#[\PHPUnit\Framework\Attributes\DataProvider('ltrimProvider')]
public function testTrimLeft(string $string, ?string $charlist, string $expected)
{
$s = new StringObject($string);
Expand All @@ -577,8 +577,8 @@ public function testTrimLeft(string $string, ?string $charlist, string $expected
*
* @return void
*
* @dataProvider rtrimProvider
*/
#[\PHPUnit\Framework\Attributes\DataProvider('rtrimProvider')]
public function testTrimRight(string $string, ?string $charlist, string $expected)
{
$s = new StringObject($string);
Expand All @@ -598,8 +598,8 @@ public function testTrimRight(string $string, ?string $charlist, string $expecte
*
* @return void
*
* @dataProvider trimProvider
*/
#[\PHPUnit\Framework\Attributes\DataProvider('trimProvider')]
public function testTrim(string $string, ?string $charlist, string $expected)
{
$s = new StringObject($string);
Expand All @@ -616,8 +616,8 @@ public function testTrim(string $string, ?string $charlist, string $expected)
* @param string $string
* @param string $expected
*
* @dataProvider ucfirstProvider
*/
#[\PHPUnit\Framework\Attributes\DataProvider('ucfirstProvider')]
public function testUpperCaseFirst(string $string, string $expected)
{
$s = new StringObject($string);
Expand All @@ -634,8 +634,8 @@ public function testUpperCaseFirst(string $string, string $expected)
* @param string $string
* @param string $expected
*
* @dataProvider lcfirstProvider
*/
#[\PHPUnit\Framework\Attributes\DataProvider('lcfirstProvider')]
public function testLowerCaseFirst(string $string, string $expected)
{
$s = new StringObject($string);
Expand All @@ -654,8 +654,8 @@ public function testLowerCaseFirst(string $string, string $expected)
*
* @return void
*
* @dataProvider ucwordsProvider
*/
#[\PHPUnit\Framework\Attributes\DataProvider('ucwordsProvider')]
public function testUpperCaseWords(string $string, string $expected)
{
$s = new StringObject($string);
Expand All @@ -674,8 +674,8 @@ public function testUpperCaseWords(string $string, string $expected)
* @param int $expected
* @param bool $caseSensitive
*
* @dataProvider substrCountProvider
*/
#[\PHPUnit\Framework\Attributes\DataProvider('substrCountProvider')]
public function testSubstrCount(string $string, string $search, int $expected, bool $caseSensitive)
{
$s = new StringObject($string);
Expand All @@ -692,8 +692,8 @@ public function testSubstrCount(string $string, string $search, int $expected, b
*
* @return void
*
* @dataProvider indexOfProvider
*/
#[\PHPUnit\Framework\Attributes\DataProvider('indexOfProvider')]
public function testIndexOf(string $string, string $search, $expected)
{
$s = new StringObject($string);
Expand Down Expand Up @@ -727,8 +727,8 @@ public static function indexOfProvider(): array
*
* @return void
*
* @dataProvider indexOfLastProvider
*/
#[\PHPUnit\Framework\Attributes\DataProvider('indexOfLastProvider')]
public function testIndexOfLast(string $string, string $search, $expected)
{
$s = new StringObject($string);
Expand Down Expand Up @@ -762,8 +762,8 @@ public static function indexOfLastProvider(): array
*
* @return void
*
* @dataProvider explodeProvider
*/
#[\PHPUnit\Framework\Attributes\DataProvider('explodeProvider')]
public function testExplode(string $string, string $delimiter, array $expected)
{
$s = new StringObject($string);
Expand Down

0 comments on commit f7d5888

Please sign in to comment.