Skip to content

Commit

Permalink
Remove use of deprecated classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Feb 14, 2020
1 parent 3a6a2c2 commit 0c97982
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 22 deletions.
7 changes: 5 additions & 2 deletions tests/TestCase/Command/CacheCommandsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@

use Cake\Cache\Cache;
use Cake\Console\Shell;
use Cake\TestSuite\ConsoleIntegrationTestCase;
use Cake\TestSuite\ConsoleIntegrationTestTrait;
use Cake\TestSuite\TestCase;

/**
* Cache Commands tests.
*/
class CacheCommandsTest extends ConsoleIntegrationTestCase
class CacheCommandsTest extends TestCase
{
use ConsoleIntegrationTestTrait;

/**
* setup method
*
Expand Down
7 changes: 5 additions & 2 deletions tests/TestCase/Command/CompletionCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@
use Cake\Command\Command;
use Cake\Core\Configure;
use Cake\Routing\Router;
use Cake\TestSuite\ConsoleIntegrationTestCase;
use Cake\TestSuite\ConsoleIntegrationTestTrait;
use Cake\TestSuite\TestCase;

/**
* CompletionCommandTest
*/
class CompletionCommandTest extends ConsoleIntegrationTestCase
class CompletionCommandTest extends TestCase
{
use ConsoleIntegrationTestTrait;

/**
* setUp method
*
Expand Down
7 changes: 5 additions & 2 deletions tests/TestCase/Command/I18nCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@
*/
namespace Cake\Test\TestCase\Command;

use Cake\TestSuite\ConsoleIntegrationTestCase;
use Cake\TestSuite\ConsoleIntegrationTestTrait;
use Cake\TestSuite\TestCase;

/**
* I18nCommand test.
*/
class I18nCommandTest extends ConsoleIntegrationTestCase
class I18nCommandTest extends TestCase
{
use ConsoleIntegrationTestTrait;

/**
* setup method
*
Expand Down
17 changes: 11 additions & 6 deletions tests/TestCase/Command/I18nExtractCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@
namespace Cake\Test\TestCase\Command;

use Cake\Core\Configure;
use Cake\Filesystem\Folder;
use Cake\TestSuite\ConsoleIntegrationTestCase;
use Cake\Filesystem\Filesystem;
use Cake\TestSuite\ConsoleIntegrationTestTrait;
use Cake\TestSuite\TestCase;

/**
* I18nExtractCommandTest
*
*/
class I18nExtractCommandTest extends ConsoleIntegrationTestCase
class I18nExtractCommandTest extends TestCase
{
use ConsoleIntegrationTestTrait;

/**
* setUp method
*
Expand All @@ -38,7 +41,9 @@ public function setUp(): void
$this->setAppNamespace();

$this->path = TMP . 'tests/extract_task_test';
new Folder($this->path . DS . 'locale', true);
$fs = new Filesystem();
$fs->deleteDir($this->path);
$fs->mkdir($this->path . DS . 'locale');
}

/**
Expand All @@ -50,8 +55,8 @@ public function tearDown(): void
{
parent::tearDown();

$Folder = new Folder($this->path);
$Folder->delete();
$fs = new Filesystem();
$fs->deleteDir($this->path);
$this->clearPlugins();
}

Expand Down
8 changes: 2 additions & 6 deletions tests/TestCase/Command/PluginLoadCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
namespace Cake\Test\TestCase\Command;

use Cake\Command\Command;
use Cake\Filesystem\File;
use Cake\TestSuite\ConsoleIntegrationTestTrait;
use Cake\TestSuite\TestCase;

Expand Down Expand Up @@ -47,9 +46,7 @@ public function setUp(): void
parent::setUp();

$this->app = APP . DS . 'Application.php';

$app = new File($this->app, false);
$this->originalAppContent = $app->read();
$this->originalAppContent = file_get_contents($this->app);

$this->useCommandRunner();
$this->setAppNamespace();
Expand All @@ -64,8 +61,7 @@ public function tearDown(): void
{
parent::tearDown();

$app = new File($this->app, false);
$app->write($this->originalAppContent);
file_put_contents($this->app, $this->originalAppContent);
}

/**
Expand Down
7 changes: 5 additions & 2 deletions tests/TestCase/Command/RoutesCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@

use Cake\Command\Command;
use Cake\Routing\Router;
use Cake\TestSuite\ConsoleIntegrationTestCase;
use Cake\TestSuite\ConsoleIntegrationTestTrait;
use Cake\TestSuite\TestCase;

/**
* RoutesCommandTest
*/
class RoutesCommandTest extends ConsoleIntegrationTestCase
class RoutesCommandTest extends TestCase
{
use ConsoleIntegrationTestTrait;

/**
* setUp method
*
Expand Down
7 changes: 5 additions & 2 deletions tests/TestCase/TestSuite/ConsoleIntegrationTestTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@
namespace Cake\Test\TestCase\TestSuite;

use Cake\Console\Shell;
use Cake\TestSuite\ConsoleIntegrationTestCase;
use Cake\TestSuite\ConsoleIntegrationTestTrait;
use Cake\TestSuite\Stub\MissingConsoleInputException;
use Cake\TestSuite\TestCase;
use PHPUnit\Framework\AssertionFailedError;

class ConsoleIntegrationTestTraitTest extends ConsoleIntegrationTestCase
class ConsoleIntegrationTestTraitTest extends TestCase
{
use ConsoleIntegrationTestTrait;

/**
* setUp
*
Expand Down

0 comments on commit 0c97982

Please sign in to comment.