diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..52ae564 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,7 @@ +# Define the line ending behavior of the different file extensions +# Set default behaviour, in case users don't have core.autocrlf set. +* text=auto +* text eol=lf + +# Declare files that will always have CRLF line endings on checkout. +*.bat eol=crlf diff --git a/src/Shell/Task/I18nTask.php b/src/Shell/Task/I18nTask.php index 35f21ae..3745a8e 100644 --- a/src/Shell/Task/I18nTask.php +++ b/src/Shell/Task/I18nTask.php @@ -12,9 +12,9 @@ * @since 3.0.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ -namespace Cake\Upgrade\Console\Command\Task; +namespace Cake\Upgrade\Shell\Task; -use Cake\Upgrade\Console\Command\Task\BaseTask; +use Cake\Upgrade\Shell\Task\BaseTask; /** * I18n Task. diff --git a/src/Shell/Task/StageTask.php b/src/Shell/Task/StageTask.php index 42edcd9..58e6bbb 100644 --- a/src/Shell/Task/StageTask.php +++ b/src/Shell/Task/StageTask.php @@ -266,7 +266,7 @@ public function change($filePath, $original, $updated) { } /** - * Get the source of a file, taking account that there may be incremental diffs + * Get the source of a file, taking into account that there may be incremental diffs * * @param string $path * @return string diff --git a/tests/TestCase/Shell/Task/I18nTaskTest.php b/tests/TestCase/Shell/Task/I18nTaskTest.php new file mode 100644 index 0000000..9403a06 --- /dev/null +++ b/tests/TestCase/Shell/Task/I18nTaskTest.php @@ -0,0 +1,50 @@ +getMock('Cake\Console\ConsoleIo', [], [], '', false); + + $this->sut = $this->getMock( + 'Cake\Upgrade\Shell\Task\I18nTask', + ['in', 'out', 'hr', 'err', '_stop'], + [$io] + ); + $this->sut->loadTasks(); + } + + public function testProcess() { + $path = TESTS . 'test_files' . DS; + $result = $this->sut->process($path . 'i18n_before.php'); + $this->assertTrue($result); + + $result = $this->sut->Stage->source($path . 'i18n_before.php'); + $expected = file_get_contents($path . 'i18n_after.php'); + $this->assertTextEquals($expected, $result); + } + +} \ No newline at end of file diff --git a/tests/TestCase/Shell/empty b/tests/TestCase/Shell/empty deleted file mode 100644 index e69de29..0000000 diff --git a/tests/test_files/i18n_after.php b/tests/test_files/i18n_after.php new file mode 100644 index 0000000..d0355c8 --- /dev/null +++ b/tests/test_files/i18n_after.php @@ -0,0 +1,10 @@ +