forked from wallabag/wallabag
Remove voter & add tests
This commit is contained in:
@ -75,6 +75,11 @@ class PocketControllerTest extends WallabagTestCase
|
||||
->method('getRequestToken')
|
||||
->willReturn('token');
|
||||
|
||||
$pocketImport
|
||||
->expects($this->once())
|
||||
->method('isEnabled')
|
||||
->willReturn(true);
|
||||
|
||||
static::$kernel->getContainer()->set(PocketImport::class, $pocketImport);
|
||||
|
||||
$client->request('POST', '/import/pocket/auth');
|
||||
@ -97,6 +102,11 @@ class PocketControllerTest extends WallabagTestCase
|
||||
->method('authorize')
|
||||
->willReturn(false);
|
||||
|
||||
$pocketImport
|
||||
->expects($this->once())
|
||||
->method('isEnabled')
|
||||
->willReturn(true);
|
||||
|
||||
static::$kernel->getContainer()->set(PocketImport::class, $pocketImport);
|
||||
|
||||
$client->request('GET', '/import/pocket/callback');
|
||||
@ -131,6 +141,11 @@ class PocketControllerTest extends WallabagTestCase
|
||||
->method('import')
|
||||
->willReturn(true);
|
||||
|
||||
$pocketImport
|
||||
->expects($this->once())
|
||||
->method('isEnabled')
|
||||
->willReturn(true);
|
||||
|
||||
static::$kernel->getContainer()->set(PocketImport::class, $pocketImport);
|
||||
|
||||
$client->request('GET', '/import/pocket/callback');
|
||||
@ -139,4 +154,17 @@ class PocketControllerTest extends WallabagTestCase
|
||||
$this->assertStringContainsString('/', $client->getResponse()->headers->get('location'), 'Import is ok, redirect to homepage');
|
||||
$this->assertSame('flashes.import.notice.summary', $client->getContainer()->get(SessionInterface::class)->getFlashBag()->peek('notice')[0]);
|
||||
}
|
||||
|
||||
public function testImportPocketDisabled()
|
||||
{
|
||||
$this->logInAs('admin');
|
||||
$client = $this->getTestClient();
|
||||
$client->getContainer()->get(Config::class)->set('pocket_enabled', 0);
|
||||
|
||||
$client->request('GET', '/import/pocket');
|
||||
|
||||
$this->assertSame(404, $client->getResponse()->getStatusCode());
|
||||
|
||||
$client->getContainer()->get(Config::class)->set('pocket_enabled', 1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user