Created
September 5, 2017 14:11
-
-
Save muskie9/3c578d4a4a372214ffa06a444fd9775e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace MySite\Tests; | |
use SilverStripe\Dev\SapphireTest; | |
/** | |
* Class PageTest | |
* @package MySite\Tests | |
*/ | |
class PageTest extends SapphireTest | |
{ | |
/** | |
* @var string | |
*/ | |
protected static $fixture_file = ''; | |
/** | |
* | |
*/ | |
public function testLink() | |
{ | |
$this->logInWithPermission('ADMIN'); | |
$page = \Page::create(['title' => 'Hello World', 'URLSegment' => 'hello-world']); | |
$page->write(); | |
$page->publishRecursive(); | |
$expected = '/hello-world/'; | |
$actual = $page->Link(); //- actual is absolute path to webroot /var/www/public/silverstripe4.dev | |
$this->assertEquals($expected, $actual); | |
$this->logOut(); | |
} | |
} |
Author
muskie9
commented
Sep 5, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment