mirror of
https://github.com/wallabag/wallabag.git
synced 2025-07-12 16:58:37 +00:00
Merge pull request #3133 from wallabag/testing-travis-failure
Let's play !
This commit is contained in:
commit
9d521dbfee
3 changed files with 29 additions and 37 deletions
|
@ -69,6 +69,15 @@ before_install:
|
||||||
script:
|
script:
|
||||||
- travis_wait bash composer install -o --no-interaction --no-progress --prefer-dist
|
- travis_wait bash composer install -o --no-interaction --no-progress --prefer-dist
|
||||||
- ant prepare-$DB
|
- ant prepare-$DB
|
||||||
|
|
||||||
|
- echo "travis_fold:start:migrations"
|
||||||
|
- php bin/console doctrine:migrations:migrate --no-interaction --env=test
|
||||||
|
- echo "travis_fold:end:migrations"
|
||||||
|
|
||||||
|
- echo "travis_fold:start:fixtures"
|
||||||
|
- php bin/console doctrine:fixtures:load --no-interaction --env=test
|
||||||
|
- echo "travis_fold:end:fixtures"
|
||||||
|
|
||||||
- if [[ $VALIDATE_TRANSLATION_FILE = '' ]]; then ./bin/simple-phpunit -v ; fi;
|
- if [[ $VALIDATE_TRANSLATION_FILE = '' ]]; then ./bin/simple-phpunit -v ; fi;
|
||||||
- if [[ $CS_FIXER = run ]]; then php bin/php-cs-fixer fix src/ --verbose --dry-run ; fi;
|
- if [[ $CS_FIXER = run ]]; then php bin/php-cs-fixer fix src/ --verbose --dry-run ; fi;
|
||||||
- if [[ $VALIDATE_TRANSLATION_FILE = run ]]; then php bin/console lint:yaml src/Wallabag/CoreBundle/Resources/translations -v ; fi;
|
- if [[ $VALIDATE_TRANSLATION_FILE = run ]]; then php bin/console lint:yaml src/Wallabag/CoreBundle/Resources/translations -v ; fi;
|
||||||
|
|
36
build.xml
36
build.xml
|
@ -62,18 +62,6 @@
|
||||||
<arg value="data/sql/mysql_base.sql"/>
|
<arg value="data/sql/mysql_base.sql"/>
|
||||||
<arg value="--env=test"/>
|
<arg value="--env=test"/>
|
||||||
</exec>
|
</exec>
|
||||||
<exec executable="php">
|
|
||||||
<arg value="${basedir}/bin/console"/>
|
|
||||||
<arg value="doctrine:migrations:migrate"/>
|
|
||||||
<arg value="--no-interaction"/>
|
|
||||||
<arg value="--env=test"/>
|
|
||||||
</exec>
|
|
||||||
<exec executable="php">
|
|
||||||
<arg value="${basedir}/bin/console"/>
|
|
||||||
<arg value="doctrine:fixtures:load"/>
|
|
||||||
<arg value="--no-interaction"/>
|
|
||||||
<arg value="--env=test"/>
|
|
||||||
</exec>
|
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="prepare_sqlite" description="Run test for SQLite">
|
<target name="prepare_sqlite" description="Run test for SQLite">
|
||||||
|
@ -103,18 +91,6 @@
|
||||||
<arg value="doctrine:schema:create"/>
|
<arg value="doctrine:schema:create"/>
|
||||||
<arg value="--env=test"/>
|
<arg value="--env=test"/>
|
||||||
</exec>
|
</exec>
|
||||||
<exec executable="php">
|
|
||||||
<arg value="${basedir}/bin/console"/>
|
|
||||||
<arg value="doctrine:migrations:migrate"/>
|
|
||||||
<arg value="--no-interaction"/>
|
|
||||||
<arg value="--env=test"/>
|
|
||||||
</exec>
|
|
||||||
<exec executable="php">
|
|
||||||
<arg value="${basedir}/bin/console"/>
|
|
||||||
<arg value="doctrine:fixtures:load"/>
|
|
||||||
<arg value="--no-interaction"/>
|
|
||||||
<arg value="--env=test"/>
|
|
||||||
</exec>
|
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="prepare_pgsql" description="Run test for PostgreSQL">
|
<target name="prepare_pgsql" description="Run test for PostgreSQL">
|
||||||
|
@ -149,18 +125,6 @@
|
||||||
<arg value="-f"/>
|
<arg value="-f"/>
|
||||||
<arg value="data/sql/pgsql_base.sql"/>
|
<arg value="data/sql/pgsql_base.sql"/>
|
||||||
</exec>
|
</exec>
|
||||||
<exec executable="php">
|
|
||||||
<arg value="${basedir}/bin/console"/>
|
|
||||||
<arg value="doctrine:migrations:migrate"/>
|
|
||||||
<arg value="--no-interaction"/>
|
|
||||||
<arg value="--env=test"/>
|
|
||||||
</exec>
|
|
||||||
<exec executable="php">
|
|
||||||
<arg value="${basedir}/bin/console"/>
|
|
||||||
<arg value="doctrine:fixtures:load"/>
|
|
||||||
<arg value="--no-interaction"/>
|
|
||||||
<arg value="--env=test"/>
|
|
||||||
</exec>
|
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="phpunit" description="Run unit tests with PHPUnit + HTML Coverage">
|
<target name="phpunit" description="Run unit tests with PHPUnit + HTML Coverage">
|
||||||
|
|
|
@ -8,8 +8,24 @@ use Wallabag\CoreBundle\Entity\Entry;
|
||||||
|
|
||||||
class EntryControllerTest extends WallabagCoreTestCase
|
class EntryControllerTest extends WallabagCoreTestCase
|
||||||
{
|
{
|
||||||
|
public $downloadImagesEnabled = false;
|
||||||
public $url = 'http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html';
|
public $url = 'http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @after
|
||||||
|
*
|
||||||
|
* Ensure download_images_enabled is disabled after each script
|
||||||
|
*/
|
||||||
|
public function tearDownImagesEnabled()
|
||||||
|
{
|
||||||
|
if ($this->downloadImagesEnabled) {
|
||||||
|
$client = static::createClient();
|
||||||
|
$client->getContainer()->get('craue_config')->set('download_images_enabled', 0);
|
||||||
|
|
||||||
|
$this->downloadImagesEnabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function testLogin()
|
public function testLogin()
|
||||||
{
|
{
|
||||||
$client = $this->getClient();
|
$client = $this->getClient();
|
||||||
|
@ -905,6 +921,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
public function testNewEntryWithDownloadImagesEnabled()
|
public function testNewEntryWithDownloadImagesEnabled()
|
||||||
{
|
{
|
||||||
|
$this->downloadImagesEnabled = true;
|
||||||
$this->logInAs('admin');
|
$this->logInAs('admin');
|
||||||
$client = $this->getClient();
|
$client = $this->getClient();
|
||||||
|
|
||||||
|
@ -935,7 +952,8 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
$this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $entry);
|
$this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $entry);
|
||||||
$this->assertEquals($url, $entry->getUrl());
|
$this->assertEquals($url, $entry->getUrl());
|
||||||
$this->assertContains('Perpignan', $entry->getTitle());
|
$this->assertContains('Perpignan', $entry->getTitle());
|
||||||
$this->assertContains('/c4789a7f.jpeg', $entry->getContent());
|
// instead of checking for the filename (which might change) check that the image is now local
|
||||||
|
$this->assertContains('http://v2.wallabag.org/assets/images/', $entry->getContent());
|
||||||
|
|
||||||
$client->getContainer()->get('craue_config')->set('download_images_enabled', 0);
|
$client->getContainer()->get('craue_config')->set('download_images_enabled', 0);
|
||||||
}
|
}
|
||||||
|
@ -945,6 +963,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
*/
|
*/
|
||||||
public function testRemoveEntryWithDownloadImagesEnabled()
|
public function testRemoveEntryWithDownloadImagesEnabled()
|
||||||
{
|
{
|
||||||
|
$this->downloadImagesEnabled = true;
|
||||||
$this->logInAs('admin');
|
$this->logInAs('admin');
|
||||||
$client = $this->getClient();
|
$client = $this->getClient();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue