diff --git a/src/Tests/FeedCreation.php b/src/Tests/FeedCreation.php new file mode 100644 index 0000000..45d7011 --- /dev/null +++ b/src/Tests/FeedCreation.php @@ -0,0 +1,104 @@ +admin_user = $this->drupalCreateUser(['administer feeds', 'access feed overview']); + // Login the user. + $this->drupalLogin($this->admin_user); + + // Copied from the node module. Create Basic page and Article node types. + if ($this->profile != 'standard') { + $this->drupalCreateContentType([ + 'type' => 'page', + 'name' => 'Basic page', + 'display_submitted' => FALSE, + ]); + $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']); + } + } + + /** + * Create a simple default feed_importer entity trough the UI. + */ + public function testSimpleFeedCreation() { + $this->drupalGet('admin/structure/feeds'); + // Add a importer. + $this->clickLink('Add importer'); + + // The only thing we need to supply is the label value. All the other values + // can just be the default values. + $this->drupalPostForm(NULL, [ + 'label' => 'First importer', + 'id' => 'first_importer', + ], 'Save'); + + // Make sure we get a valid page. + $this->assertResponse(200); + } + + /** + * The overview page does not work. + */ + public function testContentFeedsPage() { + $entity = entity_create('feeds_importer', [ + 'label' => 'First importer', + 'id' => 'first_importer', + 'import_period' => 0, + 'fetcher' => 'http', + 'fetcher_configuration' => [ + 'auto_detect_feeds' => 1, + 'use_pubsubhubbub' => 0, + 'designated_hub' => '', + 'request_timeout' => 30, + ], + 'parser' => 'sitemap', + 'parser_configuration' => [], + 'processor' => 'entity:node', + 'processor_configuration' => [], + ]); + $entity->save(); + + // Get the overview page. + $this->drupalGet('admin/content/feed'); + // Let's try to add a feed. + $this->clickLink('Add feed'); + + // Make sure we have a valid response. + $this->assertResponse(200); + + } + +}