Skip to content
Permalink
Browse files

Don't output domain files when merge is enabled.

When merged pot files are requested, don't output both the merged file
and the individual pot files.

Refs #7345
  • Loading branch information...
markstory committed Sep 5, 2015
1 parent 530719b commit ec0e14ae353f1c9f34d457b99e6039df7b88a14c
Showing with 27 additions and 3 deletions.
  1. +2 −1 src/Shell/Task/ExtractTask.php
  2. +25 −2 tests/TestCase/Shell/Task/ExtractTaskTest.php
@@ -482,9 +482,10 @@ protected function _buildFiles()
$sentence .= "msgstr[1] \"\"\n\n";
}
$this->_store($domain, $header, $sentence);
if ($domain !== 'default' && $this->_merge) {
$this->_store('default', $header, $sentence);
} else {
$this->_store($domain, $header, $sentence);
}
}
}
@@ -69,11 +69,11 @@ public function tearDown()
*/
public function testExecute()
{
$this->Task->interactive = false;
$this->Task->params['paths'] = TEST_APP . 'TestApp' . DS . 'Template' . DS . 'Pages';
$this->Task->params['output'] = $this->path . DS;
$this->Task->params['extract-core'] = 'no';
$this->Task->params['merge'] = 'no';
$this->Task->expects($this->never())->method('err');
$this->Task->expects($this->any())->method('in')
->will($this->returnValue('y'));
@@ -132,6 +132,29 @@ public function testExecute()
$this->assertRegExp($pattern, $result);
}
/**
* testExecute with merging on method
*
* @return void
*/
public function testExecuteMerge()
{
$this->Task->params['paths'] = TEST_APP . 'TestApp' . DS . 'Template' . DS . 'Pages';
$this->Task->params['output'] = $this->path . DS;
$this->Task->params['extract-core'] = 'no';
$this->Task->params['merge'] = 'yes';
$this->Task->expects($this->never())->method('err');
$this->Task->expects($this->any())->method('in')
->will($this->returnValue('y'));
$this->Task->expects($this->never())->method('_stop');
$this->Task->main();
$this->assertFileExists($this->path . DS . 'default.pot');
$this->assertFileNotExists($this->path . DS . 'cake.pot');
$this->assertFileNotExists($this->path . DS . 'domain.pot');
}
/**
* test exclusions
*

0 comments on commit ec0e14a

Please sign in to comment.
You can’t perform that action at this time.