mirror of
https://github.com/wallabag/wallabag.git
synced 2024-12-16 12:46:27 +00:00
426bb453d2
I've added a toggle feature (in internal settings) so that user api creation can be disabled while form registration still can be enabled. Also, the /api/user endpoint shouldn't require authentication. Even if we check the authentication when sending a GET request, to retrieve current user information. I've moved all the internal settings definition to config to avoid duplicated place to define them. I don't know why we didn't did that earlier.
21 lines
668 B
PHP
21 lines
668 B
PHP
<?php
|
|
|
|
namespace Tests\Wallabag\ApiBundle\Controller;
|
|
|
|
use Tests\Wallabag\ApiBundle\WallabagApiTestCase;
|
|
|
|
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->request('GET', '/api/version');
|
|
|
|
$this->assertEquals(200, $client->getResponse()->getStatusCode());
|
|
|
|
$content = json_decode($client->getResponse()->getContent(), true);
|
|
|
|
$this->assertEquals($client->getContainer()->getParameter('wallabag_core.version'), $content);
|
|
}
|
|
}
|