From 143ac751a5edcff38bad3776c25787ed485dda6f Mon Sep 17 00:00:00 2001 From: Chris Leppanen <chris.leppanen@gmail.com> Date: Fri, 29 Jun 2012 17:58:56 -0700 Subject: [PATCH] Fixed: feeds_mapper_file.test. --- tests/feeds_mapper_file.test | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/tests/feeds_mapper_file.test b/tests/feeds_mapper_file.test index d642e949..15d3f558 100644 --- a/tests/feeds_mapper_file.test +++ b/tests/feeds_mapper_file.test @@ -30,7 +30,16 @@ class FeedsMapperFileTestCase extends FeedsMapperTestCase { // site before running the test, it will work fine. Since it is truly screwy, lets just // force it to use drupal_http_request for this test case. variable_set('feeds_never_use_curl', TRUE); - + variable_set('clean_url', TRUE); + + // Only download simplepie if the plugin doesn't already exist somewhere. + // People running tests locally might have it. + if (!feeds_library_exists('simplepie.inc', 'simplepie')) { + $this->downloadExtractSimplePie('1.2.1'); + $this->assertTrue(feeds_library_exists('simplepie.inc', 'simplepie')); + // Reset all the caches! + $this->resetAll(); + } $typename = $this->createContentType(array(), array('files' => 'file')); // 1) Test mapping remote resources to file field. @@ -56,7 +65,7 @@ class FeedsMapperFileTestCase extends FeedsMapperTestCase { $nid = $this->createFeedNode('syndication', $GLOBALS['base_url'] . '/testing/feeds/flickr.xml'); $this->assertText('Created 5 nodes'); - $files = $this->testFiles(); + $files = $this->_testFiles(); $entities = db_select('feeds_item') ->fields('feeds_item', array('entity_id')) ->condition('id', 'syndication') @@ -105,7 +114,7 @@ class FeedsMapperFileTestCase extends FeedsMapperTestCase { $this->assertText('Created 5 nodes'); // Assert: files should be in resources/. - $files = $this->testFiles(); + $files = $this->_testFiles(); $entities = db_select('feeds_item') ->fields('feeds_item', array('entity_id')) ->condition('id', 'node') @@ -131,7 +140,7 @@ class FeedsMapperFileTestCase extends FeedsMapperTestCase { $this->assertText('Created 5 nodes'); // Assert: files should be in images/ now. - $files = $this->testFiles(); + $files = $this->_testFiles(); $entities = db_select('feeds_item') ->fields('feeds_item', array('entity_id')) ->condition('id', 'node') @@ -145,7 +154,7 @@ class FeedsMapperFileTestCase extends FeedsMapperTestCase { // Deleting all imported items will delete the files from the images/ dir. // @todo: for some reason the first file does not get deleted. // $this->drupalPost('import/node/delete-items', array(), 'Delete'); -// foreach ($this->testFiles() as $file) { +// foreach ($this->_testFiles() as $file) { // $this->assertFalse(is_file("public://images/$file")); // } } @@ -153,7 +162,7 @@ class FeedsMapperFileTestCase extends FeedsMapperTestCase { /** * Lists test files. */ - public function testFiles() { + public function _testFiles() { return array('tubing.jpeg', 'foosball.jpeg', 'attersee.jpeg', 'hstreet.jpeg', 'la fayette.jpeg'); } -- GitLab