Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
andrej-griniuk committed Oct 10, 2017
1 parent a3697dd commit e6e673e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/TestCase/Shell/Task/AssetsTaskTest.php
Expand Up @@ -216,21 +216,23 @@ public function testCopyOverwrite()

$this->Task->copy();

$pluginPath = TEST_APP . 'Plugin' . DS . 'TestPlugin' . DS . 'webroot';

$path = WWW_ROOT . 'test_plugin';
$dir = new \SplFileInfo($path);
$this->assertTrue($dir->isDir());
$this->assertFileExists($path . DS . 'root.js');

unlink($path . DS . 'root.js');
file_put_contents($path . DS . 'root.js', 'updated');

$this->Task->copy();

$this->assertFileNotExists($path . DS . 'root.js');
$this->assertFileNotEquals($path . DS . 'root.js', $pluginPath . DS . 'root.js');

$this->Task->params['overwrite'] = true;
$this->Task->copy();

$this->assertFileExists($path . DS . 'root.js');
$this->assertFileEquals($path . DS . 'root.js', $pluginPath . DS . 'root.js');

$folder = new Folder($path);
$folder->delete();
Expand Down

0 comments on commit e6e673e

Please sign in to comment.