nuvoleweb / integration

This project allows a content Producer to share its content with multiple Consumers using a shared Backend.
https://www.drupal.org/project/integration
6 stars 3 forks source link

Make sure tests also run without an internet connection #1

Open ademarco opened 9 years ago

ademarco commented 9 years ago

Problem

Test would fail when ran wihtout an active internet connection. This is due to image fields using remote data sources. Test output is as below:

$ ./vendor/bin/phpunit 
PHPUnit 4.5.1 by Sebastian Bergmann and contributors.

Configuration read from .../integration/sites/all/modules/contrib/integration/phpunit.xml

.............F.....................

Time: 9.81 seconds, Memory: 32.50Mb

There was 1 failure:

1) Drupal\integration\Tests\Consumer\Migrate\ArticlesMigrationTest::testContentMigration
Failed asserting that 'http://placehold.it/300x150&text=English+1' contains "".

.../integration/sites/all/modules/contrib/integration/tests/Consumer/Migrate/ArticlesMigrationTest.php:58
.../integration/sites/all/modules/contrib/integration/vendor/phpunit/phpunit/phpunit:36

FAILURES!
Tests: 35, Assertions: 307, Failures: 1.

Solution

Make sure that all data used in tests is local taking into account that we only use http://placehold.it/ as remote data source.