X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Fmodules%2Fsystem%2Fsrc%2FTests%2FSystem%2FFrontPageTest.php;fp=web%2Fcore%2Fmodules%2Fsystem%2Fsrc%2FTests%2FSystem%2FFrontPageTest.php;h=0000000000000000000000000000000000000000;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=e24e90c31c17d2d7229c72ce9b2dfade7c4ce6e4;hpb=74df008bdbb3a11eeea356744f39b802369bda3c;p=yaffs-website diff --git a/web/core/modules/system/src/Tests/System/FrontPageTest.php b/web/core/modules/system/src/Tests/System/FrontPageTest.php deleted file mode 100644 index e24e90c31..000000000 --- a/web/core/modules/system/src/Tests/System/FrontPageTest.php +++ /dev/null @@ -1,88 +0,0 @@ -drupalLogin($this->drupalCreateUser([ - 'access content', - 'administer site configuration', - ])); - $this->drupalCreateContentType(['type' => 'page']); - $this->nodePath = "node/" . $this->drupalCreateNode(['promote' => 1])->id(); - - // Configure 'node' as front page. - $this->config('system.site')->set('page.front', '/node')->save(); - // Enable front page logging in system_test.module. - \Drupal::state()->set('system_test.front_page_output', 1); - } - - /** - * Test front page functionality. - */ - public function testDrupalFrontPage() { - // Create a promoted node to test the tag on the front page view. - $settings = [ - 'title' => $this->randomMachineName(8), - 'promote' => 1, - ]; - $this->drupalCreateNode($settings); - $this->drupalGet(''); - $this->assertTitle('Home | Drupal'); - - $this->assertText(t('On front page.'), 'Path is the front page.'); - $this->drupalGet('node'); - $this->assertText(t('On front page.'), 'Path is the front page.'); - $this->drupalGet($this->nodePath); - $this->assertNoText(t('On front page.'), 'Path is not the front page.'); - - // Change the front page to an invalid path. - $edit = ['site_frontpage' => '/kittens']; - $this->drupalPostForm('admin/config/system/site-information', $edit, t('Save configuration')); - $this->assertText(t("Either the path '@path' is invalid or you do not have access to it.", ['@path' => $edit['site_frontpage']])); - - // Change the front page to a path without a starting slash. - $edit = ['site_frontpage' => $this->nodePath]; - $this->drupalPostForm('admin/config/system/site-information', $edit, t('Save configuration')); - $this->assertRaw(SafeMarkup::format("The path '%path' has to start with a slash.", ['%path' => $edit['site_frontpage']])); - - // Change the front page to a valid path. - $edit['site_frontpage'] = '/' . $this->nodePath; - $this->drupalPostForm('admin/config/system/site-information', $edit, t('Save configuration')); - $this->assertText(t('The configuration options have been saved.'), 'The front page path has been saved.'); - - $this->drupalGet(''); - $this->assertText(t('On front page.'), 'Path is the front page.'); - $this->drupalGet('node'); - $this->assertNoText(t('On front page.'), 'Path is not the front page.'); - $this->drupalGet($this->nodePath); - $this->assertText(t('On front page.'), 'Path is the front page.'); - } - -}