Skip to content

Commit

Permalink
Fix use of internal seeder within open-source modules
Browse files Browse the repository at this point in the history
(cherry picked from commit a946827aae2eca67cb34b8491d7d1485d4d75875)
  • Loading branch information
rootpd committed Aug 12, 2024
1 parent f347a24 commit 8cd7114
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@

namespace Crm\ScenariosModule\Tests\Scenarios\TriggerHandlers;

use Crm\DenniknModule\Seeders\AddressTypesSeeder;
use Crm\ScenariosModule\Scenarios\TriggerHandlers\AddressChangedTriggerHandler;
use Crm\ScenariosModule\Tests\BaseTestCase;
use Crm\UsersModule\Repositories\AddressTypesRepository;
use Crm\UsersModule\Repositories\AddressesRepository;
use Crm\UsersModule\Repositories\UsersRepository;
use Crm\UsersModule\Seeders\AddressTypesTestSeeder;
use Exception;

class AddressChangedTriggerHandlerTest extends BaseTestCase
Expand All @@ -17,14 +18,15 @@ protected function requiredRepositories(): array
return [
...parent::requiredRepositories(),
AddressesRepository::class,
AddressTypesRepository::class,
];
}

protected function requiredSeeders(): array
{
return [
...parent::requiredSeeders(),
AddressTypesSeeder::class,
AddressTypesTestSeeder::class,
];
}

Expand Down Expand Up @@ -52,7 +54,7 @@ public function testHandleEvent(): void
$addressesRepository = $this->getRepository(AddressesRepository::class);
$address = $addressesRepository->add(
$user,
AddressTypesSeeder::CROWDFUNDING_SOCIAL_NETWORKS,
AddressTypesTestSeeder::ADDRESS_TYPE,
firstName: null,
lastName: null,
address: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@

namespace Crm\ScenariosModule\Tests\Scenarios\TriggerHandlers;

use Crm\DenniknModule\Seeders\AddressTypesSeeder;
use Crm\ScenariosModule\Scenarios\TriggerHandlers\NewAddressTriggerHandler;
use Crm\ScenariosModule\Tests\BaseTestCase;
use Crm\UsersModule\Repositories\AddressTypesRepository;
use Crm\UsersModule\Repositories\AddressesRepository;
use Crm\UsersModule\Repositories\UsersRepository;
use Crm\UsersModule\Seeders\AddressTypesTestSeeder;
use Exception;

class NewAddressTriggerHandlerTest extends BaseTestCase
Expand All @@ -17,14 +18,15 @@ protected function requiredRepositories(): array
return [
...parent::requiredRepositories(),
AddressesRepository::class,
AddressTypesRepository::class,
];
}

protected function requiredSeeders(): array
{
return [
...parent::requiredSeeders(),
AddressTypesSeeder::class,
AddressTypesTestSeeder::class,
];
}

Expand Down Expand Up @@ -52,7 +54,7 @@ public function testHandleEvent(): void
$addressesRepository = $this->getRepository(AddressesRepository::class);
$address = $addressesRepository->add(
$user,
AddressTypesSeeder::CROWDFUNDING_SOCIAL_NETWORKS,
AddressTypesTestSeeder::ADDRESS_TYPE,
firstName: null,
lastName: null,
address: null,
Expand Down

0 comments on commit 8cd7114

Please sign in to comment.