test: add gandi provider test

This commit is contained in:
Maël Gangloff
2025-10-17 12:39:40 +02:00
parent 64fe0c895b
commit a7d07be1be
9 changed files with 98 additions and 9 deletions

View File

@@ -32,7 +32,7 @@ final class ConnectorControllerTest extends ApiTestCase
'waiveRetractationPeriod' => true,
'acceptConditions' => true,
'ownerLegalAge' => true,
'token' => '',
'token' => 'test',
],
'provider' => 'gandi',
]]);
@@ -69,4 +69,23 @@ final class ConnectorControllerTest extends ApiTestCase
]]);
$this->assertResponseStatusCodeSame(400);
}
public function testCreateConnectorValidAuthData(): void
{
$gandiToken = static::getContainer()->getParameter('gandi_pat_token');
if (!$gandiToken) {
$this->markTestSkipped('Missing Gandi PAT token');
}
$client = ConnectorControllerTest::createClientWithCredentials(ConnectorControllerTest::getToken(UserFactory::createOne()));
$client->request('POST', '/api/connectors', ['json' => [
'authData' => [
'waiveRetractationPeriod' => true,
'acceptConditions' => true,
'ownerLegalAge' => true,
'token' => $gandiToken,
],
'provider' => 'gandi',
]]);
$this->assertResponseStatusCodeSame(201);
}
}