Skip to content

Commit

Permalink
cleanup test files
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Scherer committed Jun 26, 2015
1 parent a4ef84a commit 7fb05fd
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions tests/TestCase/Shell/I18nShellTest.php
Expand Up @@ -35,6 +35,8 @@ public function setUp()
parent::setUp();
$this->io = $this->getMock('Cake\Console\ConsoleIo');
$this->shell = new I18nShell($this->io);

$this->localeDir = TMP . 'Locale' . DS;
}

/**
Expand All @@ -45,6 +47,14 @@ public function setUp()
public function tearDown()
{
parent::tearDown();

$deDir = $this->localeDir . 'de' . DS;

unlink($this->localeDir . 'default.pot');
unlink($this->localeDir . 'cake.pot');

unlink($deDir . 'default.po');
unlink($deDir . 'cake.po');
}

/**
Expand All @@ -54,13 +64,13 @@ public function tearDown()
*/
public function testInit()
{
$localeDir = TMP . 'Locale' . DS;
$deDir = $localeDir . 'de' . DS;

$deDir = $this->localeDir . 'de' . DS;
if (!is_dir($deDir)) {
mkdir($deDir, 0770, true);
}
file_put_contents($localeDir . 'default.pot', 'Testing POT file.');
file_put_contents($localeDir . 'cake.pot', 'Testing POT file.');
file_put_contents($this->localeDir . 'default.pot', 'Testing POT file.');
file_put_contents($this->localeDir . 'cake.pot', 'Testing POT file.');
if (file_exists($deDir . 'default.po')) {
unlink($deDir . 'default.po');
}
Expand All @@ -73,7 +83,7 @@ public function testInit()
->will($this->returnValue('de'));
$this->shell->io()->expects($this->at(1))
->method('ask')
->will($this->returnValue($localeDir));
->will($this->returnValue($this->localeDir));

$this->shell->params['verbose'] = true;
$this->shell->init();
Expand Down

0 comments on commit 7fb05fd

Please sign in to comment.