|
@@ 88-96 (lines=9) @@
|
| 85 |
|
$this->assertTrue($app->isErrorPage()); |
| 86 |
|
} |
| 87 |
|
|
| 88 |
|
public function testIsHomePage() { |
| 89 |
|
Url::instance()->setUrl(''); |
| 90 |
|
$app = new Application(); |
| 91 |
|
$this->assertTrue($app->isHomePage()); |
| 92 |
|
|
| 93 |
|
Url::instance()->setUrl('index'); |
| 94 |
|
$app2 = new Application(); |
| 95 |
|
$this->assertTrue($app2->isHomePage()); |
| 96 |
|
} |
| 97 |
|
|
| 98 |
|
public function testIsNotHomePage() { |
| 99 |
|
Url::instance()->setUrl('index'); |
|
@@ 98-107 (lines=10) @@
|
| 95 |
|
$this->assertTrue($app2->isHomePage()); |
| 96 |
|
} |
| 97 |
|
|
| 98 |
|
public function testIsNotHomePage() { |
| 99 |
|
Url::instance()->setUrl('index'); |
| 100 |
|
$app = new Application(); |
| 101 |
|
$app->pageNotFound(); |
| 102 |
|
$this->assertFalse($app->isHomePage()); |
| 103 |
|
|
| 104 |
|
Url::instance()->setUrl('other-page'); |
| 105 |
|
$app2 = new Application(); |
| 106 |
|
$this->assertFalse($app2->isHomePage()); |
| 107 |
|
} |
| 108 |
|
|
| 109 |
|
public function testIsLocalHost() { |
| 110 |
|
$app = new Application(); |
|
@@ 147-155 (lines=9) @@
|
| 144 |
|
$this->assertEquals($currentUrl, $app->getUrl()); |
| 145 |
|
} |
| 146 |
|
|
| 147 |
|
public function testValidatePage404() { |
| 148 |
|
Url::instance()->setUrl('this-url-doent-exist'); |
| 149 |
|
$app = new Application(); |
| 150 |
|
$this->assertEquals('This Url Doent Exist', $app->getTitle()); |
| 151 |
|
|
| 152 |
|
Url::instance()->setUrl('404'); |
| 153 |
|
$app2 = new Application(); |
| 154 |
|
$this->assertNotEquals('404', $app2->getTitle()); |
| 155 |
|
} |
| 156 |
|
|
| 157 |
|
} |
| 158 |
|
|