Skip to content

Commit

Permalink
tests: add a NetworkCalls group for tests making network calls
Browse files Browse the repository at this point in the history
Excluding this group can decrease the run time of tests during
development.

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
  • Loading branch information
Kdecherf committed Apr 18, 2020
1 parent ee7e186 commit 773625e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
6 changes: 6 additions & 0 deletions tests/Wallabag/CoreBundle/Command/ReloadEntryCommandTest.php
Expand Up @@ -45,6 +45,9 @@ public function setUp()
$this->getEntityManager()->flush();
}

/**
* @group NetworkCalls
*/
public function testRunReloadEntryCommand()
{
$application = new Application($this->getClient()->getKernel());
Expand All @@ -70,6 +73,9 @@ public function testRunReloadEntryCommand()
$this->assertContains('Done', $tester->getDisplay());
}

/**
* @group NetworkCalls
*/
public function testRunReloadEntryWithUsernameCommand()
{
$application = new Application($this->getClient()->getKernel());
Expand Down
3 changes: 3 additions & 0 deletions tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php
Expand Up @@ -812,6 +812,9 @@ public function testDeleteUserButtonVisibility()
$em->flush();
}

/**
* @group NetworkCalls
*/
public function testDeleteAccount()
{
$client = $this->getClient();
Expand Down
26 changes: 21 additions & 5 deletions tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php
Expand Up @@ -40,6 +40,9 @@ public function testLogin()
$this->assertContains('login', $client->getResponse()->headers->get('location'));
}

/**
* @group NetworkCalls
*/
public function testQuickstart()
{
$this->logInAs('empty');
Expand Down Expand Up @@ -87,6 +90,9 @@ public function testGetNew()
$this->assertCount(1, $crawler->filter('form[name=entry]'));
}

/**
* @group NetworkCalls
*/
public function testPostNewViaBookmarklet()
{
$this->logInAs('admin');
Expand Down Expand Up @@ -131,7 +137,7 @@ public function testPostNewEmpty()
}

/**
* This test will require an internet connection.
* @group NetworkCalls
*/
public function testPostNewOk()
{
Expand Down Expand Up @@ -169,6 +175,9 @@ public function testPostNewOk()
$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';
Expand Down Expand Up @@ -229,6 +238,9 @@ public function testPostNewOkUrlExist()
$this->assertContains('/view/', $client->getResponse()->getTargetUrl());
}

/**
* @group NetworkCalls
*/
public function testPostNewOkUrlExistWithAccent()
{
$this->logInAs('admin');
Expand Down Expand Up @@ -265,7 +277,7 @@ public function testPostNewOkUrlExistWithAccent()
}

/**
* This test will require an internet connection.
* @group NetworkCalls
*/
public function testPostNewOkUrlExistWithRedirection()
{
Expand Down Expand Up @@ -303,7 +315,7 @@ public function testPostNewOkUrlExistWithRedirection()
}

/**
* This test will require an internet connection.
* @group NetworkCalls
*/
public function testPostNewThatWillBeTagged()
{
Expand Down Expand Up @@ -430,7 +442,7 @@ public function testView()
}

/**
* This test will require an internet connection.
* @group NetworkCalls
*/
public function testReload()
{
Expand Down Expand Up @@ -1056,6 +1068,9 @@ public function testShareEntryPublicly()
$this->assertSame(404, $client->getResponse()->getStatusCode());
}

/**
* @group NetworkCalls
*/
public function testNewEntryWithDownloadImagesEnabled()
{
$this->downloadImagesEnabled = true;
Expand Down Expand Up @@ -1383,6 +1398,7 @@ public function dataForLanguage()

/**
* @dataProvider dataForLanguage
* @group NetworkCalls
*/
public function testLanguageValidation($url, $expectedLanguage)
{
Expand Down Expand Up @@ -1414,7 +1430,7 @@ public function testLanguageValidation($url, $expectedLanguage)
}

/**
* This test will require an internet connection.
* @group NetworkCalls
*/
public function testRestrictedArticle()
{
Expand Down

0 comments on commit 773625e

Please sign in to comment.