diff --git a/src/Task/File/Replace.php b/src/Task/File/Replace.php index b88567fd3..031e201ee 100644 --- a/src/Task/File/Replace.php +++ b/src/Task/File/Replace.php @@ -23,6 +23,11 @@ * ->regex('~^service:~') * ->to('services:') * ->run(); + * + * $this->taskReplaceInFile('box/robo.txt') + * ->from(array('##dbname##', 'robo')) + * ->to(array('##dbhost## ', 'localhost')) + * ->run(); * ?> * ``` * diff --git a/tests/cli/WriteFileCest.php b/tests/cli/WriteFileCest.php index 69ee45601..913da8b69 100644 --- a/tests/cli/WriteFileCest.php +++ b/tests/cli/WriteFileCest.php @@ -64,5 +64,15 @@ public function replaceInFile(CliGuy $I) $I->seeFileContentsEqual('B'); } + + public function replaceMultipleInFile(CliGuy $I) + { + $I->taskReplaceInFile('box/robo.txt') + ->from(array('HELLO', 'ROBO')) + ->to(array('Hello ', 'robo.li!')) + ->run(); + $I->seeFileFound('box/robo.txt'); + $I->seeFileContentsEqual('Hello robo.li!'); + } }