Skip to content

Commit

Permalink
Fix issue with using tests/Application interface in src/ class
Browse files Browse the repository at this point in the history
  • Loading branch information
senghe committed Oct 1, 2024
1 parent 90fe6a0 commit c69c93c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/EventSubscriber/UserRegistrationAgreementSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@

namespace BitBag\SyliusAgreementPlugin\EventSubscriber;

use BitBag\SyliusAgreementPlugin\Entity\Agreement\AgreementsRequiredInterface;
use BitBag\SyliusAgreementPlugin\Handler\AgreementHandler;
use Doctrine\Common\Collections\Collection;
use Sylius\Bundle\ResourceBundle\Event\ResourceControllerEvent;
use Sylius\Component\Core\Model\CustomerInterface;
use Sylius\Component\Core\Model\ShopUserInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Tests\BitBag\SyliusAgreementPlugin\Entity\Customer\CustomerInterface;
use Webmozart\Assert\Assert;

class UserRegistrationAgreementSubscriber implements EventSubscriberInterface
Expand All @@ -42,6 +43,7 @@ public function processAgreementsFromUserRegister(ResourceControllerEvent $resou
/** @var ?CustomerInterface $customer */
$customer = $resourceControllerEvent->getSubject();
Assert::isInstanceOf($customer, CustomerInterface::class);
Assert::isInstanceOf($customer, AgreementsRequiredInterface::class);

/** @var ?ShopUserInterface $shopUser */
$shopUser = $customer->getUser();
Expand Down

0 comments on commit c69c93c

Please sign in to comment.