@sergiu17 That worked for me for one seeder.
<?php
use App\Models\Deal;
use Illuminate\Support\Facades\Storage;
test('deals scope of active returns status 8', function() {
$this->seed(DealsTestSeeder::class);
$this->seed(DealsFinSeeder::class);
$this->assertEquals(34, Deal::active()->count());
});
This gives me
Tests\Feature\ProjectPerformanceReportTest > deals scope of active returns status 8
Illuminate\Contracts\Container\BindingResolutionException
Target class [DealsFinSeeder] does not exist.
at vendor/laravel/framework/src/Illuminate/Container/Container.php:807
803▕
804▕ try {
805▕ $reflector = new ReflectionClass($concrete);
806▕ } catch (ReflectionException $e) {
➜ 807▕ throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e);
808▕ }
809▕
810▕ // If the type is not instantiable, the developer is attempting to resolve
811▕ // an abstract type such as an Interface or Abstract Class and there is
+25 vendor frames
26 tests/Feature/ProjectPerformanceReportTest.php:8
Illuminate\Foundation\Testing\TestCase::seed("DealsFinSeeder")
To be more logical I created a TestingDatabaseSeeder which looks like this
use Illuminate\Database\Eloquent\Model;
class TestingDatabaseSeeder extends Seeder
{
public function run()
{
Model::unguard();
$this->call(DealsTestSeeder::class);
$this->call(DealsFinSeeder::class);
Model::reguard();
}
}
However
test('deals scope of active returns status 8', function() {
$this->seed(TestingDatabaseSeeder::class);
$this->assertEquals(34, Deal::active()->count());
});
results in our old friend
Target class [DealsFinSeeder] does not exist.
at vendor/laravel/framework/src/Illuminate/Container/Container.php:807
803▕
804▕ try {
805▕ $reflector = new ReflectionClass($concrete);
806▕ } catch (ReflectionException $e) {
➜ 807▕ throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e);
808▕ }
809▕
810▕ // If the type is not instantiable, the developer is attempting to resolve
811▕ // an abstract type such as an Interface or Abstract Class and there is
+8 vendor frames
9 database/seeds/TestingDatabaseSeeder.php:12
Illuminate\Database\Seeder::call("DealsFinSeeder")