forked from wallabag/wallabag
Fix createClient() depreciation
This commit is contained in:
@ -31,7 +31,7 @@ class ConfigRestControllerTest extends WallabagApiTestCase
|
||||
|
||||
public function testGetConfigWithoutAuthentication()
|
||||
{
|
||||
$client = static::createClient();
|
||||
$client = $this->createUnauthorizedClient();
|
||||
$client->request('GET', '/api/config.json');
|
||||
$this->assertSame(401, $client->getResponse()->getStatusCode());
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ class UserRestControllerTest extends WallabagApiTestCase
|
||||
|
||||
public function testGetUserWithoutAuthentication()
|
||||
{
|
||||
$client = static::createClient();
|
||||
$client = $this->createUnauthorizedClient();
|
||||
$client->request('GET', '/api/user.json');
|
||||
$this->assertSame(401, $client->getResponse()->getStatusCode());
|
||||
|
||||
@ -80,7 +80,7 @@ class UserRestControllerTest extends WallabagApiTestCase
|
||||
public function testCreateNewUserWithoutAuthentication()
|
||||
{
|
||||
// create a new client instead of using $this->client to be sure client isn't authenticated
|
||||
$client = static::createClient();
|
||||
$client = $this->createUnauthorizedClient();
|
||||
$client->getContainer()->get(Config::class)->set('api_user_registration', 1);
|
||||
$client->request('PUT', '/api/user.json', [
|
||||
'username' => 'google',
|
||||
@ -115,7 +115,7 @@ class UserRestControllerTest extends WallabagApiTestCase
|
||||
|
||||
public function testCreateNewUserWithExistingEmail()
|
||||
{
|
||||
$client = static::createClient();
|
||||
$client = $this->createUnauthorizedClient();
|
||||
$client->getContainer()->get(Config::class)->set('api_user_registration', 1);
|
||||
$client->request('PUT', '/api/user.json', [
|
||||
'username' => 'admin',
|
||||
@ -144,7 +144,7 @@ class UserRestControllerTest extends WallabagApiTestCase
|
||||
|
||||
public function testCreateNewUserWithTooShortPassword()
|
||||
{
|
||||
$client = static::createClient();
|
||||
$client = $this->createUnauthorizedClient();
|
||||
$client->getContainer()->get(Config::class)->set('api_user_registration', 1);
|
||||
$client->request('PUT', '/api/user.json', [
|
||||
'username' => 'facebook',
|
||||
@ -168,7 +168,7 @@ class UserRestControllerTest extends WallabagApiTestCase
|
||||
|
||||
public function testCreateNewUserWhenRegistrationIsDisabled()
|
||||
{
|
||||
$client = static::createClient();
|
||||
$client = $this->createUnauthorizedClient();
|
||||
$client->request('PUT', '/api/user.json', [
|
||||
'username' => 'facebook',
|
||||
'password' => 'face',
|
||||
|
||||
@ -10,7 +10,7 @@ class WallabagRestControllerTest extends WallabagApiTestCase
|
||||
public function testGetVersion()
|
||||
{
|
||||
// create a new client instead of using $this->client to be sure client isn't authenticated
|
||||
$client = static::createClient();
|
||||
$client = $this->createUnauthorizedClient();
|
||||
$client->request('GET', '/api/version');
|
||||
|
||||
$this->assertSame(200, $client->getResponse()->getStatusCode());
|
||||
@ -23,7 +23,7 @@ class WallabagRestControllerTest extends WallabagApiTestCase
|
||||
public function testGetInfo()
|
||||
{
|
||||
// create a new client instead of using $this->client to be sure client isn't authenticated
|
||||
$client = static::createClient();
|
||||
$client = $this->createUnauthorizedClient();
|
||||
$client->request('GET', '/api/info');
|
||||
|
||||
$this->assertSame(200, $client->getResponse()->getStatusCode());
|
||||
@ -40,7 +40,7 @@ class WallabagRestControllerTest extends WallabagApiTestCase
|
||||
public function testAllowedRegistration()
|
||||
{
|
||||
// create a new client instead of using $this->client to be sure client isn't authenticated
|
||||
$client = static::createClient();
|
||||
$client = $this->createUnauthorizedClient();
|
||||
|
||||
if (!$client->getContainer()->getParameter('fosuser_registration')) {
|
||||
$this->markTestSkipped('fosuser_registration is not enabled.');
|
||||
|
||||
Reference in New Issue
Block a user