tests: add a NetworkCalls group for tests making network calls

Excluding this group can decrease the run time of tests during
development.

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
This commit is contained in:
Kevin Decherf 2020-03-10 22:22:51 +01:00
parent 25c754f62f
commit 71f7e58fbd
3 changed files with 30 additions and 5 deletions

View file

@ -45,6 +45,9 @@ class ReloadEntryCommandTest extends WallabagCoreTestCase
$this->getEntityManager()->flush();
}
/**
* @group NetworkCalls
*/
public function testRunReloadEntryCommand()
{
$application = new Application($this->getClient()->getKernel());
@ -70,6 +73,9 @@ class ReloadEntryCommandTest extends WallabagCoreTestCase
$this->assertContains('Done', $tester->getDisplay());
}
/**
* @group NetworkCalls
*/
public function testRunReloadEntryWithUsernameCommand()
{
$application = new Application($this->getClient()->getKernel());

View file

@ -812,6 +812,9 @@ class ConfigControllerTest extends WallabagCoreTestCase
$em->flush();
}
/**
* @group NetworkCalls
*/
public function testDeleteAccount()
{
$client = $this->getClient();

View file

@ -40,6 +40,9 @@ class EntryControllerTest extends WallabagCoreTestCase
$this->assertContains('login', $client->getResponse()->headers->get('location'));
}
/**
* @group NetworkCalls
*/
public function testQuickstart()
{
$this->logInAs('empty');
@ -87,6 +90,9 @@ class EntryControllerTest extends WallabagCoreTestCase
$this->assertCount(1, $crawler->filter('form[name=entry]'));
}
/**
* @group NetworkCalls
*/
public function testPostNewViaBookmarklet()
{
$this->logInAs('admin');
@ -131,7 +137,7 @@ class EntryControllerTest extends WallabagCoreTestCase
}
/**
* This test will require an internet connection.
* @group NetworkCalls
*/
public function testPostNewOk()
{
@ -169,6 +175,9 @@ class EntryControllerTest extends WallabagCoreTestCase
$client->getContainer()->get('craue_config')->set('store_article_headers', 0);
}
/**
* @group NetworkCalls
*/
public function testPostWithMultipleAuthors()
{
$url = 'https://www.liberation.fr/planete/2017/04/05/donald-trump-et-xi-jinping-tentative-de-flirt-en-floride_1560768';
@ -229,6 +238,9 @@ class EntryControllerTest extends WallabagCoreTestCase
$this->assertContains('/view/', $client->getResponse()->getTargetUrl());
}
/**
* @group NetworkCalls
*/
public function testPostNewOkUrlExistWithAccent()
{
$this->logInAs('admin');
@ -265,7 +277,7 @@ class EntryControllerTest extends WallabagCoreTestCase
}
/**
* This test will require an internet connection.
* @group NetworkCalls
*/
public function testPostNewOkUrlExistWithRedirection()
{
@ -303,7 +315,7 @@ class EntryControllerTest extends WallabagCoreTestCase
}
/**
* This test will require an internet connection.
* @group NetworkCalls
*/
public function testPostNewThatWillBeTagged()
{
@ -430,7 +442,7 @@ class EntryControllerTest extends WallabagCoreTestCase
}
/**
* This test will require an internet connection.
* @group NetworkCalls
*/
public function testReload()
{
@ -1056,6 +1068,9 @@ class EntryControllerTest extends WallabagCoreTestCase
$this->assertSame(404, $client->getResponse()->getStatusCode());
}
/**
* @group NetworkCalls
*/
public function testNewEntryWithDownloadImagesEnabled()
{
$this->downloadImagesEnabled = true;
@ -1383,6 +1398,7 @@ class EntryControllerTest extends WallabagCoreTestCase
/**
* @dataProvider dataForLanguage
* @group NetworkCalls
*/
public function testLanguageValidation($url, $expectedLanguage)
{
@ -1414,7 +1430,7 @@ class EntryControllerTest extends WallabagCoreTestCase
}
/**
* This test will require an internet connection.
* @group NetworkCalls
*/
public function testRestrictedArticle()
{