Skip to content

Commit

Permalink
refactor FileUtilsFake: moved to Utils
Browse files Browse the repository at this point in the history
  • Loading branch information
Wtyd committed Jul 3, 2024
1 parent a733d93 commit 5845000
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<?php

namespace Tests\Utils;
namespace Wtyd\GitHooks\Utils;

use Wtyd\GitHooks\Utils\FileUtils;

class FileUtilsFake extends FileUtils
{
/** @var array */
protected $modifiedFiles = [];

/** @var array */
protected $filesThatShouldBeFoundInDirectories = [];

public function getModifiedFiles(): array
Expand Down
21 changes: 0 additions & 21 deletions tests/System/Commands/CreateConfigurationFileCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,11 @@

namespace Tests\System\Commands;

// use Illuminate\Support\Facades\Storage;
use phpmock\Mock as PhpmockMock;
use phpmock\MockBuilder;
use Tests\Utils\TestCase\SystemTestCase;
use Wtyd\GitHooks\Utils\Storage;

class CreateConfigurationFileCommandTest extends SystemTestCase
{
/**
* @return PhpmockMock
*/
public function getMockRootDirectory(): PhpmockMock
{
$builder = new MockBuilder();
// $builder->setNamespace('Wtyd\GitHooks\App\Commands')
$builder->setNamespace('Illuminate\Filesystem')
->setName('getcwd')
->setFunction(
function () {
return $this->getPath();
}
);

return $builder->build();
}

/** @test */
function it_creates_the_configuration_file_in_the_root_of_the_project_using_the_template()
{
Expand Down
2 changes: 1 addition & 1 deletion tests/System/Commands/ExecuteToolCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Illuminate\Support\Facades\Storage;
use Mockery\MockInterface;
use Tests\Utils\FileUtilsFake;
use Wtyd\GitHooks\Utils\FileUtilsFake;
use Tests\Utils\PhpFileBuilder;
use Tests\Utils\TestCase\SystemTestCase;
use Wtyd\GitHooks\Tools\Process\Execution\MultiProcessesExecutionFake;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/LoadTools/FastExecutionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Wtyd\GitHooks\Tools\ToolsFactoy;
use Mockery;
use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
use Tests\Utils\FileUtilsFake;
use Wtyd\GitHooks\Utils\FileUtilsFake;
use Tests\Utils\TestCase\UnitTestCase;
use Wtyd\GitHooks\ConfigurationFile\ConfigurationFile;
use Wtyd\GitHooks\ConfigurationFile\ToolConfiguration;
Expand Down
2 changes: 1 addition & 1 deletion tests/Utils/TestCase/SystemTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Tests\Utils\TestCase;

use Tests\Utils\ConfigurationFileBuilder;
use Tests\Utils\FileUtilsFake;
use Wtyd\GitHooks\Utils\FileUtilsFake;
use Tests\Utils\Traits\FileSystemTrait;
use Wtyd\GitHooks\Utils\FileUtilsInterface;

Expand Down

0 comments on commit 5845000

Please sign in to comment.