@@ 101-109 (lines=9) @@ | ||
98 | static::assertEquals(['some fish like pants should be replaced'], $newFile->getContents()); |
|
99 | } |
|
100 | ||
101 | public function testCallingReplaceTextWithArraysThatHaveMismatchedCountsThrowsAnException() |
|
102 | { |
|
103 | $file = new LocalFile(static::$dir . 'multiple_replace_failure.test'); |
|
104 | $file->put('some text that text should be replaced'); |
|
105 | ||
106 | $this->expectException(InvalidArgumentException::class); |
|
107 | ||
108 | $this->replacer->replaceText($file, ['text', 'pants that'], ['pants']); |
|
109 | } |
|
110 | ||
111 | public function testCallingReplaceTextWithAnArrayAndStringThrowsAnException() |
|
112 | { |
|
@@ 111-118 (lines=8) @@ | ||
108 | $this->replacer->replaceText($file, ['text', 'pants that'], ['pants']); |
|
109 | } |
|
110 | ||
111 | public function testCallingReplaceTextWithAnArrayAndStringThrowsAnException() |
|
112 | { |
|
113 | $file = new LocalFile(static::$dir . 'multiple_replace_failure.test'); |
|
114 | $file->put('some text that text should be replaced'); |
|
115 | ||
116 | $this->expectException(InvalidArgumentException::class); |
|
117 | $this->replacer->replaceText($file, ['text', 'pants that'], 'pants'); |
|
118 | } |
|
119 | ||
120 | public function testAddingAPostfixToTheEndOfTheFile() |
|
121 | { |
|
@@ 185-193 (lines=9) @@ | ||
182 | static::assertEquals('option_pass_through-pass.test', $newFile->getFilename()); |
|
183 | } |
|
184 | ||
185 | public function testCallingModifyWithNoFromTextThrowsInvalidArgumentsException() |
|
186 | { |
|
187 | $this->expectException(InvalidArgumentException::class); |
|
188 | ||
189 | $file = new LocalFile(static::$dir . 'simple_replace.test'); |
|
190 | $file->put('some text that text should be replaced'); |
|
191 | ||
192 | $this->replacer->modify($file, ['toText' => 'pants']); |
|
193 | } |
|
194 | ||
195 | public function testCallingModifyWithNoToTextThrowsInvalidArgumentsException() |
|
196 | { |
|
@@ 195-203 (lines=9) @@ | ||
192 | $this->replacer->modify($file, ['toText' => 'pants']); |
|
193 | } |
|
194 | ||
195 | public function testCallingModifyWithNoToTextThrowsInvalidArgumentsException() |
|
196 | { |
|
197 | $this->expectException(InvalidArgumentException::class); |
|
198 | ||
199 | $file = new LocalFile(static::$dir . 'simple_replace.test'); |
|
200 | $file->put('some text that text should be replaced'); |
|
201 | ||
202 | $this->replacer->modify($file, ['fromText' => 'pants']); |
|
203 | } |
|
204 | ||
205 | public function testCallingModifyWithANonLocalFileWillThrowAnException() |
|
206 | { |