1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-08-01 17:38:38 +00:00

Upgrade to Symfony 4.4

- disable autowiring for Event (because the Entry entity was injected)
- rename `getClient()` for test to `getTestClient()` to avoid error while overriding (from `BrowserKitAssertionsTrait`)
This commit is contained in:
Jeremy Benoist 2022-11-23 17:09:32 +01:00
parent 655ec5e07a
commit aa5c7f05b8
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C
43 changed files with 966 additions and 1239 deletions

View file

@ -11,7 +11,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase
public function testCreateClient()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$em = $client->getContainer()->get(EntityManagerInterface::class);
$nbClients = $em->getRepository(Client::class)->findAll();
@ -37,7 +37,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase
public function testCreateToken()
{
$client = $this->getClient();
$client = $this->getTestClient();
$apiClient = $this->createApiClientForUser('admin');
$client->request('POST', '/oauth/v2/token', [
@ -59,7 +59,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase
public function testCreateTokenWithBadClientId()
{
$client = $this->getClient();
$client = $this->getTestClient();
$client->request('POST', '/oauth/v2/token', [
'grant_type' => 'password',
'client_id' => '$WALLABAG_CLIENT_ID',
@ -74,7 +74,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase
public function testListingClient()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$em = $client->getContainer()->get(EntityManagerInterface::class);
$nbClients = $em->getRepository(Client::class)->findAll();
@ -86,7 +86,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase
public function testDeveloperHowto()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/developer/howto/first-app');
$this->assertSame(200, $client->getResponse()->getStatusCode());
@ -94,7 +94,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase
public function testRemoveClient()
{
$client = $this->getClient();
$client = $this->getTestClient();
$adminApiClient = $this->createApiClientForUser('admin');
$em = $client->getContainer()->get(EntityManagerInterface::class);
@ -134,7 +134,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase
*/
private function createApiClientForUser($username, $grantTypes = ['password'])
{
$client = $this->getClient();
$client = $this->getTestClient();
$em = $client->getContainer()->get(EntityManagerInterface::class);
$userManager = $client->getContainer()->get('fos_user.user_manager.test');
$user = $userManager->findUserBy(['username' => $username]);