Skip to content
Permalink
Browse files

Correcting how ExtractTask collects files. Test added. Fixes #775

  • Loading branch information...
markstory committed Jun 7, 2010
1 parent 0eea0ce commit 94fc492623fbc4f6dd042cca84109dcb8cc45194
Showing with 30 additions and 1 deletion.
  1. +1 −1 cake/console/libs/tasks/extract.php
  2. +29 −0 cake/tests/cases/console/libs/tasks/extract.test.php
@@ -488,7 +488,7 @@ function __searchFiles() {
foreach ($this->__paths as $path) {
$Folder = new Folder($path);
$files = $Folder->findRecursive('.*\.(php|ctp|thtml|inc|tpl)', true);
$this->__files += $files;
$this->__files = array_merge($this->__files, $files);
}
}
}
@@ -155,4 +155,33 @@ function testExecute() {
$Folder = new Folder($path);
$Folder->delete();
}
function getTests() {
return array('start', 'startCase', 'testExtractMultiplePaths', 'endCase', 'end');
}
/**
* test extract can read more than one path.
*
* @return void
*/
function testExtractMultiplePaths() {
$path = TMP . 'tests' . DS . 'extract_task_test';
new Folder($path . DS . 'locale', true);
$this->Task->interactive = false;
$this->Task->params['paths'] =
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'pages,' .
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'posts';
$this->Task->params['output'] = $path . DS;
$this->Task->Dispatch->expectNever('stderr');
$this->Task->Dispatch->expectNever('_stop');
$this->Task->execute();
$result = file_get_contents($path . DS . 'default.pot');
$pattern = '/msgid "Add User"/';
$this->assertPattern($pattern, $result);
}
}

0 comments on commit 94fc492

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