|
|
@@ -15,7 +15,6 @@ use App\Service\Utils\DatesUtils;
|
|
|
use Doctrine\ORM\EntityManagerInterface;
|
|
|
use PHPUnit\Framework\MockObject\MockObject;
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
-use Psr\Log\LoggerInterface;
|
|
|
use Symfony\Contracts\HttpClient\HttpClientInterface;
|
|
|
use Symfony\Contracts\HttpClient\ResponseInterface;
|
|
|
|
|
|
@@ -67,7 +66,6 @@ class HelloAssoServiceTest extends TestCase
|
|
|
private OrganizationRepository|MockObject $organizationRepository;
|
|
|
private EventRepository|MockObject $eventRepository;
|
|
|
private EntityManagerInterface|MockObject $entityManager;
|
|
|
- private LoggerInterface|MockObject $logger;
|
|
|
|
|
|
private string $baseUrl = 'https://test-base.com';
|
|
|
private string $publicAppBaseUrl = 'https://test-public.com';
|
|
|
@@ -93,10 +91,6 @@ class HelloAssoServiceTest extends TestCase
|
|
|
$this->entityManager = $this->getMockBuilder(EntityManagerInterface::class)
|
|
|
->disableOriginalConstructor()
|
|
|
->getMock();
|
|
|
-
|
|
|
- $this->logger = $this->getMockBuilder(LoggerInterface::class)
|
|
|
- ->disableOriginalConstructor()
|
|
|
- ->getMock();
|
|
|
}
|
|
|
|
|
|
private function getHelloAssoServiceMockFor(string $methodName): TestableHelloAssoService|MockObject
|
|
|
@@ -106,14 +100,12 @@ class HelloAssoServiceTest extends TestCase
|
|
|
$this->httpClient,
|
|
|
$this->organizationRepository,
|
|
|
$this->eventRepository,
|
|
|
- $this->baseUrl,
|
|
|
$this->publicAppBaseUrl,
|
|
|
$this->helloAssoApiBaseUrl,
|
|
|
$this->helloAssoAuthBaseUrl,
|
|
|
$this->helloAssoClientId,
|
|
|
$this->helloAssoClientSecret,
|
|
|
$this->entityManager,
|
|
|
- $this->logger,
|
|
|
])
|
|
|
->setMethodsExcept([$methodName])
|
|
|
->getMock();
|
|
|
@@ -130,12 +122,12 @@ class HelloAssoServiceTest extends TestCase
|
|
|
|
|
|
$service->expects(self::once())
|
|
|
->method('fetchAccessToken')
|
|
|
- ->with(null)
|
|
|
+ ->with(null, null)
|
|
|
->willReturn($tokensData);
|
|
|
|
|
|
$service->expects(self::once())
|
|
|
->method('updateDomain')
|
|
|
- ->with($tokensData, 'https://*.opentalent.fr');
|
|
|
+ ->with('test-token', 'https://*.opentalent.fr');
|
|
|
|
|
|
$service->setupOpentalentDomain();
|
|
|
}
|