Skip to content
Snippets Groups Projects
Commit 143ac751 authored by Chris Leppanen's avatar Chris Leppanen
Browse files

Fixed: feeds_mapper_file.test.

parent 56d2c6be
No related branches found
No related tags found
No related merge requests found
...@@ -30,7 +30,16 @@ class FeedsMapperFileTestCase extends FeedsMapperTestCase { ...@@ -30,7 +30,16 @@ class FeedsMapperFileTestCase extends FeedsMapperTestCase {
// site before running the test, it will work fine. Since it is truly screwy, lets just // 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. // force it to use drupal_http_request for this test case.
variable_set('feeds_never_use_curl', TRUE); 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')); $typename = $this->createContentType(array(), array('files' => 'file'));
// 1) Test mapping remote resources to file field. // 1) Test mapping remote resources to file field.
...@@ -56,7 +65,7 @@ class FeedsMapperFileTestCase extends FeedsMapperTestCase { ...@@ -56,7 +65,7 @@ class FeedsMapperFileTestCase extends FeedsMapperTestCase {
$nid = $this->createFeedNode('syndication', $GLOBALS['base_url'] . '/testing/feeds/flickr.xml'); $nid = $this->createFeedNode('syndication', $GLOBALS['base_url'] . '/testing/feeds/flickr.xml');
$this->assertText('Created 5 nodes'); $this->assertText('Created 5 nodes');
$files = $this->testFiles(); $files = $this->_testFiles();
$entities = db_select('feeds_item') $entities = db_select('feeds_item')
->fields('feeds_item', array('entity_id')) ->fields('feeds_item', array('entity_id'))
->condition('id', 'syndication') ->condition('id', 'syndication')
...@@ -105,7 +114,7 @@ class FeedsMapperFileTestCase extends FeedsMapperTestCase { ...@@ -105,7 +114,7 @@ class FeedsMapperFileTestCase extends FeedsMapperTestCase {
$this->assertText('Created 5 nodes'); $this->assertText('Created 5 nodes');
// Assert: files should be in resources/. // Assert: files should be in resources/.
$files = $this->testFiles(); $files = $this->_testFiles();
$entities = db_select('feeds_item') $entities = db_select('feeds_item')
->fields('feeds_item', array('entity_id')) ->fields('feeds_item', array('entity_id'))
->condition('id', 'node') ->condition('id', 'node')
...@@ -131,7 +140,7 @@ class FeedsMapperFileTestCase extends FeedsMapperTestCase { ...@@ -131,7 +140,7 @@ class FeedsMapperFileTestCase extends FeedsMapperTestCase {
$this->assertText('Created 5 nodes'); $this->assertText('Created 5 nodes');
// Assert: files should be in images/ now. // Assert: files should be in images/ now.
$files = $this->testFiles(); $files = $this->_testFiles();
$entities = db_select('feeds_item') $entities = db_select('feeds_item')
->fields('feeds_item', array('entity_id')) ->fields('feeds_item', array('entity_id'))
->condition('id', 'node') ->condition('id', 'node')
...@@ -145,7 +154,7 @@ class FeedsMapperFileTestCase extends FeedsMapperTestCase { ...@@ -145,7 +154,7 @@ class FeedsMapperFileTestCase extends FeedsMapperTestCase {
// Deleting all imported items will delete the files from the images/ dir. // Deleting all imported items will delete the files from the images/ dir.
// @todo: for some reason the first file does not get deleted. // @todo: for some reason the first file does not get deleted.
// $this->drupalPost('import/node/delete-items', array(), 'Delete'); // $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")); // $this->assertFalse(is_file("public://images/$file"));
// } // }
} }
...@@ -153,7 +162,7 @@ class FeedsMapperFileTestCase extends FeedsMapperTestCase { ...@@ -153,7 +162,7 @@ class FeedsMapperFileTestCase extends FeedsMapperTestCase {
/** /**
* Lists test files. * Lists test files.
*/ */
public function testFiles() { public function _testFiles() {
return array('tubing.jpeg', 'foosball.jpeg', 'attersee.jpeg', 'hstreet.jpeg', 'la fayette.jpeg'); return array('tubing.jpeg', 'foosball.jpeg', 'attersee.jpeg', 'hstreet.jpeg', 'la fayette.jpeg');
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment