-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from dnadesign/feature/upgrade
FIX: Test example
- Loading branch information
Showing
3 changed files
with
28 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
namespace App\Pages; | ||
|
||
use Page; | ||
|
||
class HomePage extends Page | ||
{ | ||
private static $db = []; | ||
|
||
private static $has_one = []; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,24 @@ | ||
<?php | ||
|
||
use SilverStripe\Dev\SapphireTest; | ||
use App\Pages\HomePage; | ||
|
||
class HomePageTest extends SapphireTest | ||
{ | ||
public function setUpOnce() | ||
{ | ||
parent::setUpOnce(); | ||
} | ||
public function setUpOnce() | ||
{ | ||
parent::setUpOnce(); | ||
} | ||
|
||
public function testInstantiation() | ||
{ | ||
$page = new HomePage(array( | ||
'Title' => 'Home' | ||
)); | ||
$page->write(); | ||
$page->publish('Stage', 'Live'); | ||
public function testInstantiation() | ||
{ | ||
$page = new HomePage(array( | ||
'Title' => 'Home' | ||
)); | ||
$page->write(); | ||
$page->publish('Stage', 'Live'); | ||
|
||
$this->assertGreaterThan(0, $page->ID); | ||
$this->assertEquals('Home', $page->Title); | ||
} | ||
$this->assertGreaterThan(0, $page->ID); | ||
$this->assertEquals('Home', $page->Title); | ||
} | ||
} |
This file contains 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