Skip to content

Commit

Permalink
Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspertey committed Nov 16, 2024
1 parent 2725cd2 commit 18ee64d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 69 deletions.
38 changes: 0 additions & 38 deletions tests/Autoload/CommandTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?php

use Illuminate\Support\Facades\Artisan;
use Lunarstorm\LaravelDDD\Facades\Autoload;
use Lunarstorm\LaravelDDD\Support\AutoloadManager;
use Lunarstorm\LaravelDDD\Support\DomainCache;
use Lunarstorm\LaravelDDD\Tests\BootsTestApplication;
use Symfony\Component\Console\Exception\CommandNotFoundException;

uses(BootsTestApplication::class);

Expand Down Expand Up @@ -35,16 +33,6 @@

expect($mock->getRegisteredCommands())->toBeEmpty();
});

// it('does not register the commands', function () {
// config()->set('ddd.autoload.commands', false);

// Autoload::boot();

// $artisanCommands = collect(Artisan::all());

// expect($artisanCommands)->not->toHaveKeys(array_keys($this->commands));
// });
});

describe('when ddd.autoload.commands = true', function () {
Expand All @@ -55,11 +43,6 @@
$mock->boot();

expect(array_values($mock->getRegisteredCommands()))->toEqualCanonicalizing(array_values($this->commands));
// Autoload::boot();

// $artisanCommands = collect(Artisan::all());

// expect($artisanCommands)->toHaveKeys(array_keys($this->commands));
});
});

Expand All @@ -73,17 +56,6 @@
$mock->boot();

expect(array_values($mock->getRegisteredCommands()))->toEqualCanonicalizing([]);

// Autoload::boot();

// $artisanCommands = collect(Artisan::all());

// expect($artisanCommands)->not->toHaveKeys(array_keys($this->commands));

// // commands should not be recognized due to cached empty-state
// foreach ($this->commands as $command => $class) {
// expect(fn () => Artisan::call($command))->toThrow(CommandNotFoundException::class);
// }
});

it('can bust the cache', function () {
Expand All @@ -94,15 +66,5 @@
$mock->boot();

expect(array_values($mock->getRegisteredCommands()))->toEqualCanonicalizing(array_values($this->commands));

// Autoload::boot();

// $artisanCommands = collect(Artisan::all());

// expect($artisanCommands)->toHaveKeys(array_keys($this->commands));

// foreach ($this->commands as $command => $class) {
// $this->artisan($command)->assertSuccessful();
// }
});
});
31 changes: 0 additions & 31 deletions tests/Autoload/ProviderTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php

use Illuminate\Support\Facades\Artisan;
use Lunarstorm\LaravelDDD\Facades\Autoload;
use Lunarstorm\LaravelDDD\Support\AutoloadManager;
use Lunarstorm\LaravelDDD\Support\DomainCache;
use Lunarstorm\LaravelDDD\Tests\BootsTestApplication;
Expand Down Expand Up @@ -31,12 +30,6 @@
$mock = AutoloadManager::partialMock();
$mock->shouldNotReceive('handleProviders');
$mock->boot();

// Autoload::boot();

// collect($this->providers)->each(
// fn ($provider) => expect(app()->getProvider($provider))->toBeNull()
// );
});

it('does not register the providers', function () {
Expand All @@ -46,12 +39,6 @@
$mock->boot();

expect($mock->getRegisteredProviders())->toBeEmpty();

// Autoload::boot();

// collect($this->providers)->each(
// fn($provider) => expect(app()->getProvider($provider))->toBeNull()
// );
});
});

Expand All @@ -71,12 +58,6 @@
$mock->boot();

expect(array_values($mock->getRegisteredProviders()))->toEqualCanonicalizing($this->providers);

// Autoload::boot();

// collect($this->providers)->each(
// fn($provider) => expect(app()->getProvider($provider))->toBeInstanceOf($provider)
// );
});
});

Expand All @@ -90,12 +71,6 @@
$mock->boot();

expect(array_values($mock->getRegisteredProviders()))->toEqualCanonicalizing([]);

// Autoload::boot();

// collect($this->providers)->each(
// fn($provider) => expect(app()->getProvider($provider))->toBeNull()
// );
});

it('can bust the cache', function () {
Expand All @@ -108,11 +83,5 @@
$mock->boot();

expect(array_values($mock->getRegisteredProviders()))->toEqualCanonicalizing($this->providers);

// Autoload::boot();

// collect($this->providers)->each(
// fn($provider) => expect(app()->getProvider($provider))->toBeInstanceOf($provider)
// );
});
});

0 comments on commit 18ee64d

Please sign in to comment.