Browse Source

fix unit tests and lint

Olivier Massot 2 months ago
parent
commit
595e970d66

+ 0 - 1
src/Service/OnChange/Organization/OnParametersChange.php

@@ -10,7 +10,6 @@ use App\Entity\Organization\Parameters;
 use App\Enum\Education\AdvancedEducationNotationTypeEnum;
 use App\Message\Message\Typo3\Typo3Delete;
 use App\Message\Message\Typo3\Typo3JustMakeItWork;
-use App\Message\Message\Typo3\Typo3Undelete;
 use App\Message\Message\Typo3\Typo3Update;
 use App\Repository\Booking\CourseRepository;
 use App\Service\Network\Utils as NetworkUtils;

+ 1 - 1
src/Service/Typo3/Typo3Service.php

@@ -73,7 +73,7 @@ class Typo3Service
      * Update the organization's website if it exists, restore
      * it if it has been deleted, or create it if it does not exist.
      * Also removes any redirections that may have been set on the domain.
- *
+     *
      * @throws TransportExceptionInterface
      */
     public function justMakeItWorkSite(int $organizationId): ResponseInterface

+ 4 - 7
tests/Unit/Service/OnChange/Organization/OnParametersChangeTest.php

@@ -12,7 +12,7 @@ use App\Entity\Organization\Organization;
 use App\Entity\Organization\Parameters;
 use App\Enum\Education\AdvancedEducationNotationTypeEnum;
 use App\Message\Message\Typo3\Typo3Delete;
-use App\Message\Message\Typo3\Typo3Undelete;
+use App\Message\Message\Typo3\Typo3JustMakeItWork;
 use App\Message\Message\Typo3\Typo3Update;
 use App\Repository\Booking\CourseRepository;
 use App\Service\Network\Utils as NetworkUtils;
@@ -282,14 +282,11 @@ class OnParametersChangeTest extends TestCase
             ->getMock();
 
         $this->messageBus
-            ->expects(self::exactly(2))
+            ->expects(self::exactly(1))
             ->method('dispatch')
             ->willReturnCallback(function ($message) {
-                if ($message instanceof Typo3Undelete) {
-                    return new Envelope(new Typo3Undelete(1));
-                }
-                if ($message instanceof Typo3Update) {
-                    return new Envelope(new Typo3Update(1));
+                if ($message instanceof Typo3JustMakeItWork) {
+                    return new Envelope(new Typo3JustMakeItWork(1));
                 }
                 throw new \AssertionError('unexpected message : '.$message::class);
             });