mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
PHPStan level 5
This commit is contained in:
parent
3ef7064ada
commit
36eb513e1b
22 changed files with 60 additions and 47 deletions
|
@ -45,7 +45,7 @@ class UserRestControllerTest extends WallabagApiTestCase
|
|||
|
||||
public function testCreateNewUser()
|
||||
{
|
||||
$this->client->getContainer()->get(Config::class)->set('api_user_registration', 1);
|
||||
$this->client->getContainer()->get(Config::class)->set('api_user_registration', '1');
|
||||
$this->client->request('PUT', '/api/user.json', [
|
||||
'username' => 'google',
|
||||
'password' => 'googlegoogle',
|
||||
|
@ -73,14 +73,14 @@ class UserRestControllerTest extends WallabagApiTestCase
|
|||
|
||||
$this->assertSame('application/json', $this->client->getResponse()->headers->get('Content-Type'));
|
||||
|
||||
$this->client->getContainer()->get(Config::class)->set('api_user_registration', 0);
|
||||
$this->client->getContainer()->get(Config::class)->set('api_user_registration', '0');
|
||||
}
|
||||
|
||||
public function testCreateNewUserWithoutAuthentication()
|
||||
{
|
||||
// create a new client instead of using $this->client to be sure client isn't authenticated
|
||||
$client = $this->createUnauthorizedClient();
|
||||
$client->getContainer()->get(Config::class)->set('api_user_registration', 1);
|
||||
$client->getContainer()->get(Config::class)->set('api_user_registration', '1');
|
||||
$client->request('PUT', '/api/user.json', [
|
||||
'username' => 'google',
|
||||
'password' => 'googlegoogle',
|
||||
|
@ -109,13 +109,13 @@ class UserRestControllerTest extends WallabagApiTestCase
|
|||
|
||||
$this->assertSame('application/json', $client->getResponse()->headers->get('Content-Type'));
|
||||
|
||||
$client->getContainer()->get(Config::class)->set('api_user_registration', 0);
|
||||
$client->getContainer()->get(Config::class)->set('api_user_registration', '0');
|
||||
}
|
||||
|
||||
public function testCreateNewUserWithExistingEmail()
|
||||
{
|
||||
$client = $this->createUnauthorizedClient();
|
||||
$client->getContainer()->get(Config::class)->set('api_user_registration', 1);
|
||||
$client->getContainer()->get(Config::class)->set('api_user_registration', '1');
|
||||
$client->request('PUT', '/api/user.json', [
|
||||
'username' => 'admin',
|
||||
'password' => 'googlegoogle',
|
||||
|
@ -138,13 +138,13 @@ class UserRestControllerTest extends WallabagApiTestCase
|
|||
|
||||
$this->assertSame('application/json', $client->getResponse()->headers->get('Content-Type'));
|
||||
|
||||
$client->getContainer()->get(Config::class)->set('api_user_registration', 0);
|
||||
$client->getContainer()->get(Config::class)->set('api_user_registration', '0');
|
||||
}
|
||||
|
||||
public function testCreateNewUserWithTooShortPassword()
|
||||
{
|
||||
$client = $this->createUnauthorizedClient();
|
||||
$client->getContainer()->get(Config::class)->set('api_user_registration', 1);
|
||||
$client->getContainer()->get(Config::class)->set('api_user_registration', '1');
|
||||
$client->request('PUT', '/api/user.json', [
|
||||
'username' => 'facebook',
|
||||
'password' => 'face',
|
||||
|
@ -162,7 +162,7 @@ class UserRestControllerTest extends WallabagApiTestCase
|
|||
|
||||
$this->assertSame('application/json', $client->getResponse()->headers->get('Content-Type'));
|
||||
|
||||
$client->getContainer()->get(Config::class)->set('api_user_registration', 0);
|
||||
$client->getContainer()->get(Config::class)->set('api_user_registration', '0');
|
||||
}
|
||||
|
||||
public function testCreateNewUserWhenRegistrationIsDisabled()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue