Passed
Push — master ( d7fd6a...9124ff )
by Robbie
11:58
created

SitemapPageTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
dl 0
loc 22
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testSitemapShowsNavigationTitleNotNormalTitle() 0 6 1
A setUp() 0 5 1
1
<?php
2
class SitemapPageTest extends FunctionalTest {
3
4
	protected static $fixture_file = 'SitemapPageTest.yml';
5
6
	protected static $use_draft_site = true;
7
8
	public function setUp()
9
	{
10
		parent::setUp();
11
12
		Config::inst()->update('SSViewer', 'theme', 'starter');
13
	}
14
15
	/**
16
	 * Note: this test depends on the "starter" theme being installed and configured as default
17
	 */
18
	public function testSitemapShowsNavigationTitleNotNormalTitle() {
19
		$response = $this->get('sitemap');
20
		$parser = new CSSContentParser($response->getBody());
21
		$elements = $parser->getBySelector('.sitemap li.first .sitemap-link');
22
		$this->assertNotEmpty($elements);
23
		$this->assertEquals('Top page nav 1', (string) $elements[0]);
24
	}
25
}
26