From 71f7e58fbd84e1d15c7a405a3c5872adb937dc37 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Tue, 10 Mar 2020 22:22:51 +0100 Subject: [PATCH 1/1] 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 --- .../Command/ReloadEntryCommandTest.php | 6 +++++ .../Controller/ConfigControllerTest.php | 3 +++ .../Controller/EntryControllerTest.php | 26 +++++++++++++++---- 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/tests/Wallabag/CoreBundle/Command/ReloadEntryCommandTest.php b/tests/Wallabag/CoreBundle/Command/ReloadEntryCommandTest.php index c4bd6dac..a0e2939c 100644 --- a/tests/Wallabag/CoreBundle/Command/ReloadEntryCommandTest.php +++ b/tests/Wallabag/CoreBundle/Command/ReloadEntryCommandTest.php @@ -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()); diff --git a/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php b/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php index 40a1aa97..92d22267 100644 --- a/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php @@ -812,6 +812,9 @@ class ConfigControllerTest extends WallabagCoreTestCase $em->flush(); } + /** + * @group NetworkCalls + */ public function testDeleteAccount() { $client = $this->getClient(); diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index 5b806830..0aa562d8 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php @@ -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() { -- 2.41.0