mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-04 18:42:40 +00:00
Adding overwrite option to the i18n extract task
This commit is contained in:
parent
af4a2efc33
commit
5656461025
2 changed files with 31 additions and 0 deletions
|
@ -399,4 +399,26 @@ class ExtractTaskTest extends CakeTestCase {
|
|||
$pattern = '#Plugin/TestPlugin/Model/TestPluginPost.php:validation for field title#';
|
||||
$this->assertNotRegExp($pattern, $result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Test that the extract shell overwrites existing files with the overwrite parameter
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testExtractOverwrite() {
|
||||
$this->Task->interactive = false;
|
||||
|
||||
$this->Task->params['paths'] = CAKE . 'Test' . DS . 'test_app' . DS;
|
||||
$this->Task->params['output'] = $this->path . DS;
|
||||
$this->Task->params['overwrite'] = true;
|
||||
|
||||
file_put_contents($this->path . DS . 'default.pot', 'will be overwritten');
|
||||
$this->assertTrue(file_exists($this->path . DS . 'default.pot'));
|
||||
$original = file_get_contents($this->path . DS . 'default.pot');
|
||||
|
||||
$this->Task->execute();
|
||||
$result = file_get_contents($this->path . DS . 'default.pot');
|
||||
$this->assertNotEquals($original, $result);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue