diff --git a/resources/schema.json b/resources/schema.json index 117bdae6a..c99a60cb0 100644 --- a/resources/schema.json +++ b/resources/schema.json @@ -351,6 +351,7 @@ "UnwrapLcFirst": { "$ref": "#/definitions/default-mutator-config" }, "UnwrapStrRepeat": { "$ref": "#/definitions/default-mutator-config" }, "UnwrapStrReplace": { "$ref": "#/definitions/default-mutator-config" }, + "UnwrapStrShuffle": { "$ref": "#/definitions/default-mutator-config" }, "UnwrapStrToLower": { "$ref": "#/definitions/default-mutator-config" }, "UnwrapStrToUpper": { "$ref": "#/definitions/default-mutator-config" }, "UnwrapTrim": { "$ref": "#/definitions/default-mutator-config" }, diff --git a/src/Mutator/ProfileList.php b/src/Mutator/ProfileList.php index 2cc11e3a6..cbf98fc52 100644 --- a/src/Mutator/ProfileList.php +++ b/src/Mutator/ProfileList.php @@ -241,6 +241,7 @@ final class ProfileList Mutator\Unwrap\UnwrapLcFirst::class, Mutator\Unwrap\UnwrapStrRepeat::class, Mutator\Unwrap\UnwrapStrReplace::class, + Mutator\Unwrap\UnwrapStrShuffle::class, Mutator\Unwrap\UnwrapStrToLower::class, Mutator\Unwrap\UnwrapStrToUpper::class, Mutator\Unwrap\UnwrapTrim::class, @@ -423,6 +424,7 @@ final class ProfileList 'UnwrapLcFirst' => Mutator\Unwrap\UnwrapLcFirst::class, 'UnwrapStrRepeat' => Mutator\Unwrap\UnwrapStrRepeat::class, 'UnwrapStrReplace' => Mutator\Unwrap\UnwrapStrReplace::class, + 'UnwrapStrShuffle' => Mutator\Unwrap\UnwrapStrShuffle::class, 'UnwrapStrToLower' => Mutator\Unwrap\UnwrapStrToLower::class, 'UnwrapStrToUpper' => Mutator\Unwrap\UnwrapStrToUpper::class, 'UnwrapTrim' => Mutator\Unwrap\UnwrapTrim::class, diff --git a/src/Mutator/Unwrap/UnwrapStrShuffle.php b/src/Mutator/Unwrap/UnwrapStrShuffle.php new file mode 100644 index 000000000..380131e9d --- /dev/null +++ b/src/Mutator/Unwrap/UnwrapStrShuffle.php @@ -0,0 +1,72 @@ +doTest($input, $expected); + } + + public function mutationsProvider(): iterable + { + yield 'It mutates correctly when provided with a string' => [ + <<<'PHP' + [ + <<<'PHP' + [ + <<<'PHP' + [ + <<<'PHP' + [ + <<<'PHP' + [ + <<<'PHP' +bar()); +PHP + , + <<<'PHP' +bar(); +PHP + ]; + + yield 'It mutates correctly when provided with a more complex situation' => [ + <<<'PHP' + [ + <<<'PHP' + [ + <<<'PHP' + [ + <<<'PHP' +