test: add delete connector test

This commit is contained in:
Maël Gangloff
2025-10-17 20:08:56 +02:00
parent e44ecd5768
commit 28fdcd2575

View File

@@ -101,4 +101,27 @@ final class ConnectorControllerTest extends ApiTestCase
$this->expectNotToPerformAssertions();
}
public function testCreateAndDeleteConnector()
{
$gandiToken = static::getContainer()->getParameter('gandi_pat_token');
if (!$gandiToken) {
$this->markTestSkipped('Missing Gandi PAT token');
}
$client = ConnectorControllerTest::createClientWithCredentials(ConnectorControllerTest::getToken(UserFactory::createOne()));
$response = $client->request('POST', '/api/connectors', ['json' => [
'authData' => [
'waiveRetractationPeriod' => true,
'acceptConditions' => true,
'ownerLegalAge' => true,
'token' => $gandiToken,
],
'provider' => 'gandi',
]]);
$this->assertResponseStatusCodeSame(201);
$client->request('DELETE', '/api/connectors/'.$response->toArray()['id']);
$this->assertResponseStatusCodeSame(204);
}
}