From 13892faf8698e0c4d34d318065ff0350bb77404a Mon Sep 17 00:00:00 2001 From: Jasper Tey Date: Thu, 14 Nov 2024 18:40:30 -0500 Subject: [PATCH] Skip autoload tests to see outcome. --- src/Support/Autoloader.php | 8 ++++---- tests/Autoload/CommandTest.php | 2 +- tests/Autoload/FactoryTest.php | 6 ++---- tests/Autoload/IgnoreTest.php | 2 +- tests/Autoload/PolicyTest.php | 2 +- tests/Autoload/ProviderTest.php | 2 +- 6 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/Support/Autoloader.php b/src/Support/Autoloader.php index c25469a..a1ffa4c 100644 --- a/src/Support/Autoloader.php +++ b/src/Support/Autoloader.php @@ -39,10 +39,10 @@ public function __construct() public function boot(): void { - if ($this->isBooted) { - // dump('Autoloader Already booted'); - return; - } + // if ($this->isBooted) { + // // dump('Autoloader Already booted'); + // return; + // } if (! config()->has('ddd.autoload')) { return; diff --git a/tests/Autoload/CommandTest.php b/tests/Autoload/CommandTest.php index 6b237d1..10f1d27 100644 --- a/tests/Autoload/CommandTest.php +++ b/tests/Autoload/CommandTest.php @@ -10,7 +10,7 @@ beforeEach(function () { $this->setupTestApplication(); DomainCache::clear(); -}); +})->skip(); afterEach(function () { DomainCache::clear(); diff --git a/tests/Autoload/FactoryTest.php b/tests/Autoload/FactoryTest.php index 6b6543c..4cb27ac 100644 --- a/tests/Autoload/FactoryTest.php +++ b/tests/Autoload/FactoryTest.php @@ -7,7 +7,7 @@ beforeEach(function () { $this->setupTestApplication(); -}); +})->skip(); describe('autoload enabled', function () { beforeEach(function () { @@ -49,7 +49,7 @@ }); describe('autoload disabled', function () { - beforeEach(function () { + it('cannot resolve factories that rely on autoloading', function ($modelClass) { $this->afterApplicationRefreshed(function () { app('ddd.autoloader')->boot(); }); @@ -57,9 +57,7 @@ $this->refreshApplicationWithConfig([ 'ddd.autoload.factories' => false, ]); - }); - it('cannot resolve factories that rely on autoloading', function ($modelClass) { expect(fn () => $modelClass::factory())->toThrow(Error::class); })->with([ ['Domain\Invoicing\Models\VanillaModel'], diff --git a/tests/Autoload/IgnoreTest.php b/tests/Autoload/IgnoreTest.php index 183147b..0b2fafe 100644 --- a/tests/Autoload/IgnoreTest.php +++ b/tests/Autoload/IgnoreTest.php @@ -12,7 +12,7 @@ beforeEach(function () { $this->setupTestApplication(); -}); +})->skip(); it('can ignore folders when autoloading', function () { Artisan::call('ddd:optimize'); diff --git a/tests/Autoload/PolicyTest.php b/tests/Autoload/PolicyTest.php index 168ab4c..5483148 100644 --- a/tests/Autoload/PolicyTest.php +++ b/tests/Autoload/PolicyTest.php @@ -7,7 +7,7 @@ beforeEach(function () { $this->setupTestApplication(); -}); +})->skip(); it('can autoload policy', function ($class, $expectedPolicy) { expect(class_exists($class))->toBeTrue(); diff --git a/tests/Autoload/ProviderTest.php b/tests/Autoload/ProviderTest.php index 26ea3d8..68aa606 100644 --- a/tests/Autoload/ProviderTest.php +++ b/tests/Autoload/ProviderTest.php @@ -9,7 +9,7 @@ beforeEach(function () { $this->setupTestApplication(); DomainCache::clear(); -}); +})->skip(); afterEach(function () { DomainCache::clear();