|
|
@@ -20,7 +20,7 @@ use Cake\Console\ConsoleIo;
|
|
|
use Cake\Console\ConsoleOptionParser;
|
|
|
use Cake\Console\Exception\StopException;
|
|
|
use Cake\Console\Shell;
|
|
|
-use Cake\Filesystem\Folder;
|
|
|
+use Cake\Filesystem\Filesystem;
|
|
|
use Cake\TestSuite\TestCase;
|
|
|
use RuntimeException;
|
|
|
use TestApp\Shell\MergeShell;
|
|
|
@@ -64,6 +64,11 @@ class ShellTest extends TestCase
|
|
|
protected $io;
|
|
|
|
|
|
/**
|
|
|
+ * @var \Cake\Filesystem\Filesystem
|
|
|
+ */
|
|
|
+ protected $fs;
|
|
|
+
|
|
|
+ /**
|
|
|
* setUp method
|
|
|
*
|
|
|
* @return void
|
|
|
@@ -77,9 +82,10 @@ class ShellTest extends TestCase
|
|
|
->getMock();
|
|
|
$this->Shell = new ShellTestShell($this->io, $this->getTableLocator());
|
|
|
|
|
|
+ $this->fs = new Filesystem();
|
|
|
+
|
|
|
if (is_dir(TMP . 'shell_test')) {
|
|
|
- $Folder = new Folder(TMP . 'shell_test');
|
|
|
- $Folder->delete();
|
|
|
+ $this->fs->deleteDir(TMP . 'shell_test');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -490,7 +496,7 @@ class ShellTest extends TestCase
|
|
|
$path = TMP . 'shell_test';
|
|
|
$file = $path . DS . 'file1.php';
|
|
|
|
|
|
- new Folder($path, true);
|
|
|
+ $this->fs->mkdir($path);
|
|
|
|
|
|
$contents = "<?php{$eol}echo 'test';${eol}\$te = 'st';{$eol}";
|
|
|
|
|
|
@@ -517,7 +523,7 @@ class ShellTest extends TestCase
|
|
|
touch($file);
|
|
|
$this->assertFileExists($file);
|
|
|
|
|
|
- new Folder($path, true);
|
|
|
+ $this->fs->mkdir($path);
|
|
|
|
|
|
$contents = "<?php{$eol}echo 'test';${eol}\$te = 'st';{$eol}";
|
|
|
$this->Shell->interactive = false;
|
|
|
@@ -535,7 +541,7 @@ class ShellTest extends TestCase
|
|
|
$path = TMP . 'shell_test';
|
|
|
$file = $path . DS . 'file1.php';
|
|
|
|
|
|
- new Folder($path, true);
|
|
|
+ $this->fs->mkdir($path);
|
|
|
|
|
|
$this->io->expects($this->once())
|
|
|
->method('askChoice')
|
|
|
@@ -561,7 +567,7 @@ class ShellTest extends TestCase
|
|
|
$path = TMP . 'shell_test';
|
|
|
$file = $path . DS . 'file1.php';
|
|
|
|
|
|
- new Folder($path, true);
|
|
|
+ $this->fs->mkdir($path);
|
|
|
|
|
|
$this->io->expects($this->once())
|
|
|
->method('askChoice')
|
|
|
@@ -588,7 +594,7 @@ class ShellTest extends TestCase
|
|
|
$path = TMP . 'shell_test';
|
|
|
$file = $path . DS . 'file1.php';
|
|
|
|
|
|
- new Folder($path, true);
|
|
|
+ $this->fs->mkdir($path);
|
|
|
|
|
|
touch($file);
|
|
|
$this->assertFileExists($file);
|
|
|
@@ -616,7 +622,7 @@ class ShellTest extends TestCase
|
|
|
$path . DS . 'file3.php' => 'My third content',
|
|
|
];
|
|
|
|
|
|
- new Folder($path, true);
|
|
|
+ $this->fs->mkdir($path);
|
|
|
|
|
|
$this->io->expects($this->once())
|
|
|
->method('askChoice')
|