aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.travis.yml9
-rw-r--r--build.xml36
-rw-r--r--tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php21
3 files changed, 29 insertions, 37 deletions
diff --git a/.travis.yml b/.travis.yml
index fb32befb..e6cf96cb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -69,6 +69,15 @@ before_install:
69script: 69script:
70 - travis_wait bash composer install -o --no-interaction --no-progress --prefer-dist 70 - travis_wait bash composer install -o --no-interaction --no-progress --prefer-dist
71 - ant prepare-$DB 71 - ant prepare-$DB
72
73 - echo "travis_fold:start:migrations"
74 - php bin/console doctrine:migrations:migrate --no-interaction --env=test
75 - echo "travis_fold:end:migrations"
76
77 - echo "travis_fold:start:fixtures"
78 - php bin/console doctrine:fixtures:load --no-interaction --env=test
79 - echo "travis_fold:end:fixtures"
80
72 - if [[ $VALIDATE_TRANSLATION_FILE = '' ]]; then ./bin/simple-phpunit -v ; fi; 81 - if [[ $VALIDATE_TRANSLATION_FILE = '' ]]; then ./bin/simple-phpunit -v ; fi;
73 - if [[ $CS_FIXER = run ]]; then php bin/php-cs-fixer fix src/ --verbose --dry-run ; fi; 82 - if [[ $CS_FIXER = run ]]; then php bin/php-cs-fixer fix src/ --verbose --dry-run ; fi;
74 - if [[ $VALIDATE_TRANSLATION_FILE = run ]]; then php bin/console lint:yaml src/Wallabag/CoreBundle/Resources/translations -v ; fi; 83 - if [[ $VALIDATE_TRANSLATION_FILE = run ]]; then php bin/console lint:yaml src/Wallabag/CoreBundle/Resources/translations -v ; fi;
diff --git a/build.xml b/build.xml
index b5727e62..b9fe6136 100644
--- a/build.xml
+++ b/build.xml
@@ -62,18 +62,6 @@
62 <arg value="data/sql/mysql_base.sql"/> 62 <arg value="data/sql/mysql_base.sql"/>
63 <arg value="--env=test"/> 63 <arg value="--env=test"/>
64 </exec> 64 </exec>
65 <exec executable="php">
66 <arg value="${basedir}/bin/console"/>
67 <arg value="doctrine:migrations:migrate"/>
68 <arg value="--no-interaction"/>
69 <arg value="--env=test"/>
70 </exec>
71 <exec executable="php">
72 <arg value="${basedir}/bin/console"/>
73 <arg value="doctrine:fixtures:load"/>
74 <arg value="--no-interaction"/>
75 <arg value="--env=test"/>
76 </exec>
77 </target> 65 </target>
78 66
79 <target name="prepare_sqlite" description="Run test for SQLite"> 67 <target name="prepare_sqlite" description="Run test for SQLite">
@@ -103,18 +91,6 @@
103 <arg value="doctrine:schema:create"/> 91 <arg value="doctrine:schema:create"/>
104 <arg value="--env=test"/> 92 <arg value="--env=test"/>
105 </exec> 93 </exec>
106 <exec executable="php">
107 <arg value="${basedir}/bin/console"/>
108 <arg value="doctrine:migrations:migrate"/>
109 <arg value="--no-interaction"/>
110 <arg value="--env=test"/>
111 </exec>
112 <exec executable="php">
113 <arg value="${basedir}/bin/console"/>
114 <arg value="doctrine:fixtures:load"/>
115 <arg value="--no-interaction"/>
116 <arg value="--env=test"/>
117 </exec>
118 </target> 94 </target>
119 95
120 <target name="prepare_pgsql" description="Run test for PostgreSQL"> 96 <target name="prepare_pgsql" description="Run test for PostgreSQL">
@@ -149,18 +125,6 @@
149 <arg value="-f"/> 125 <arg value="-f"/>
150 <arg value="data/sql/pgsql_base.sql"/> 126 <arg value="data/sql/pgsql_base.sql"/>
151 </exec> 127 </exec>
152 <exec executable="php">
153 <arg value="${basedir}/bin/console"/>
154 <arg value="doctrine:migrations:migrate"/>
155 <arg value="--no-interaction"/>
156 <arg value="--env=test"/>
157 </exec>
158 <exec executable="php">
159 <arg value="${basedir}/bin/console"/>
160 <arg value="doctrine:fixtures:load"/>
161 <arg value="--no-interaction"/>
162 <arg value="--env=test"/>
163 </exec>
164 </target> 128 </target>
165 129
166 <target name="phpunit" description="Run unit tests with PHPUnit + HTML Coverage"> 130 <target name="phpunit" description="Run unit tests with PHPUnit + HTML Coverage">
diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php
index 19c8698e..116e5f32 100644
--- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php
+++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php
@@ -8,8 +8,24 @@ use Wallabag\CoreBundle\Entity\Entry;
8 8
9class EntryControllerTest extends WallabagCoreTestCase 9class EntryControllerTest extends WallabagCoreTestCase
10{ 10{
11 public $downloadImagesEnabled = false;
11 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'; 12 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';
12 13
14 /**
15 * @after
16 *
17 * Ensure download_images_enabled is disabled after each script
18 */
19 public function tearDownImagesEnabled()
20 {
21 if ($this->downloadImagesEnabled) {
22 $client = static::createClient();
23 $client->getContainer()->get('craue_config')->set('download_images_enabled', 0);
24
25 $this->downloadImagesEnabled = false;
26 }
27 }
28
13 public function testLogin() 29 public function testLogin()
14 { 30 {
15 $client = $this->getClient(); 31 $client = $this->getClient();
@@ -905,6 +921,7 @@ class EntryControllerTest extends WallabagCoreTestCase
905 921
906 public function testNewEntryWithDownloadImagesEnabled() 922 public function testNewEntryWithDownloadImagesEnabled()
907 { 923 {
924 $this->downloadImagesEnabled = true;
908 $this->logInAs('admin'); 925 $this->logInAs('admin');
909 $client = $this->getClient(); 926 $client = $this->getClient();
910 927
@@ -935,7 +952,8 @@ class EntryControllerTest extends WallabagCoreTestCase
935 $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $entry); 952 $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $entry);
936 $this->assertEquals($url, $entry->getUrl()); 953 $this->assertEquals($url, $entry->getUrl());
937 $this->assertContains('Perpignan', $entry->getTitle()); 954 $this->assertContains('Perpignan', $entry->getTitle());
938 $this->assertContains('/c4789a7f.jpeg', $entry->getContent()); 955 // instead of checking for the filename (which might change) check that the image is now local
956 $this->assertContains('http://v2.wallabag.org/assets/images/', $entry->getContent());
939 957
940 $client->getContainer()->get('craue_config')->set('download_images_enabled', 0); 958 $client->getContainer()->get('craue_config')->set('download_images_enabled', 0);
941 } 959 }
@@ -945,6 +963,7 @@ class EntryControllerTest extends WallabagCoreTestCase
945 */ 963 */
946 public function testRemoveEntryWithDownloadImagesEnabled() 964 public function testRemoveEntryWithDownloadImagesEnabled()
947 { 965 {
966 $this->downloadImagesEnabled = true;
948 $this->logInAs('admin'); 967 $this->logInAs('admin');
949 $client = $this->getClient(); 968 $client = $this->getClient();
950 969