Skip to content
Prev Previous commit
Next Next commit
Wip
  • Loading branch information
bakerkretzmar committed Jun 11, 2021
commit 2d8a5131fcd2d59b070ea71164c8517f7b8e73fe
16 changes: 10 additions & 6 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Tests;

use Laravel\Forge\Forge;
use LaravelZero\Framework\Testing\TestCase as BaseTestCase;
use Mockery;

Expand All @@ -11,8 +10,6 @@ abstract class TestCase extends BaseTestCase
use CreatesApplication;
use FakesForgeResources;

protected $forge;

protected function tearDown(): void
{
Mockery::close();
Expand All @@ -25,13 +22,20 @@ protected function withConfig(string $yaml): void
file_put_contents(implode(DIRECTORY_SEPARATOR, [__DIR__, 'fixtures', 'forge.yml']), $yaml);
}

protected function inFixtureDir(): static
{
chdir(__DIR__ . DIRECTORY_SEPARATOR . 'fixtures');

return $this;
}

protected function assertConfig(string $yaml): void
{
$this->assertSame($yaml, file_get_contents(implode(DIRECTORY_SEPARATOR, [__DIR__, 'fixtures', 'forge.yml'])));
$this->assertSame($yaml . PHP_EOL, file_get_contents(implode(DIRECTORY_SEPARATOR, [__DIR__, 'fixtures', 'forge.yml'])));
}

protected function mockForge(): void
protected function assertInConfig(string $yaml): void
{
$this->forge = $this->mock(Forge::class);
$this->assertStringContainsString($yaml, file_get_contents(implode(DIRECTORY_SEPARATOR, [__DIR__, 'fixtures', 'forge.yml'])));
}
}