Skip to content

Commit

Permalink
Merge pull request #56 from dnadesign/feature/upgrade
Browse files Browse the repository at this point in the history
FIX: Test example
  • Loading branch information
adrexia authored Aug 9, 2018
2 parents 6d9ca4a + 2aea53c commit 6a46570
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 14 deletions.
12 changes: 12 additions & 0 deletions app/src/Pages/HomePage.php
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 = [];
}
29 changes: 15 additions & 14 deletions app/tests/unit/HomePageTest.php
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);
}
}
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"project-files": [
"app/_config/*",
"app/css/*",
"app/src/*",
"app/images/*",
"app/tests/*",
"app/styleguide/*",
Expand Down

0 comments on commit 6a46570

Please sign in to comment.