diff --git a/demo/collect_demo.install b/demo/collect_demo.install index c11274d..a445313 100644 --- a/demo/collect_demo.install +++ b/demo/collect_demo.install @@ -77,7 +77,7 @@ function collect_demo_install() { $node->save(); // Set the node as the front page. - \Drupal::configFactory()->getEditable('system.site')->set('page.front', 'node/' . $node->id())->save(); + \Drupal::configFactory()->getEditable('system.site')->set('page.front', '/node/' . $node->id())->save(); // Fetch a web page. collect_fetch_service()->fetch('http://www.drupal.org'); diff --git a/demo/src/Tests/CollectDemoTest.php b/demo/src/Tests/CollectDemoTest.php new file mode 100644 index 0000000..3a83eed --- /dev/null +++ b/demo/src/Tests/CollectDemoTest.php @@ -0,0 +1,40 @@ +drupalCreateUser(['access administration pages', 'administer collect']); + $this->drupalLogin($user); + $this->drupalGet('/admin/content/collect'); + $this->assertText(t('collect:url')); + $host = \Drupal::request()->getHost(); + $this->assertText(t('collect:collectjson/@host/entity/node/article', array('@host' => $host))); + $this->assertText(t('collect:collectjson-definition/global/fields', array('@host' => $host))); + $this->assertText(t('collect:collectjson/@host/entity/user"', array('@host' => $host))); + $this->assertText(t('collect:collectjson-definition/global/fields')); + $this->clickLink(t('view')); + $this->drupalGet('/'); + $this->assertResponse('200'); + $this->assertText(t('Collect Demo')); + } +} diff --git a/src/Tests/CollectWebTest.php b/src/Tests/CollectWebTest.php index 9e4ad53..23903cc 100644 --- a/src/Tests/CollectWebTest.php +++ b/src/Tests/CollectWebTest.php @@ -83,7 +83,6 @@ class CollectWebTest extends WebTestBase { 'date' => (new DrupalDateTime('2014-12-16 09:40'))->getTimestamp(), )); $container->save(); - $this->drupalGet('admin/content/collect'); $this->assertResponse(403);