forked from cakephp/upgrade
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test and make sure gitattributes are set.
- Loading branch information
euromark
committed
Sep 24, 2014
1 parent
26b5cf2
commit 5930a41
Showing
7 changed files
with
80 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
namespace Cake\Upgrade\Test\TestCase\Shell\Task; | ||
|
||
use Cake\TestSuite\TestCase; | ||
use Cake\Upgrade\Shell\Task\I18nTask; | ||
|
||
/** | ||
* UpgradeShellTest | ||
* | ||
*/ | ||
class I18nTaskTest extends TestCase { | ||
|
||
/** | ||
* Upgrade shell instance | ||
* | ||
* @var mixed | ||
*/ | ||
public $sut; | ||
|
||
/** | ||
* setUp | ||
* | ||
* Create a mock for all tests to use | ||
* | ||
* @return void | ||
*/ | ||
public function setUp() { | ||
parent::setUp(); | ||
|
||
$io = $this->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); | ||
} | ||
|
||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
class Foo { | ||
|
||
public function test() { | ||
$x = __("Some {0} text", $y); | ||
$x = __d('Domain', "Some {0} {1} text {2}", $a, $b, $c); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
class Foo { | ||
|
||
public function test() { | ||
$x = __("Some %s text", $y); | ||
$x = __d('Domain', "Some %s %s text %s", $a, $b, $c); | ||
} | ||
|
||
} |