mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
Fixed tests without assertions
This commit is contained in:
parent
26bdee4f08
commit
76b99e4006
@ -72,25 +72,26 @@ class CMSMainTest extends FunctionalTest {
|
|||||||
* Test publication of one of every page type
|
* Test publication of one of every page type
|
||||||
*/
|
*/
|
||||||
public function testPublishOneOfEachKindOfPage() {
|
public function testPublishOneOfEachKindOfPage() {
|
||||||
return;
|
$this->markTestIncomplete();
|
||||||
$classes = ClassInfo::subclassesFor("SiteTree");
|
|
||||||
array_shift($classes);
|
// $classes = ClassInfo::subclassesFor("SiteTree");
|
||||||
|
// array_shift($classes);
|
||||||
|
|
||||||
foreach($classes as $class) {
|
// foreach($classes as $class) {
|
||||||
$page = new $class();
|
// $page = new $class();
|
||||||
if($class instanceof TestOnly) continue;
|
// if($class instanceof TestOnly) continue;
|
||||||
|
|
||||||
$page->Title = "Test $class page";
|
// $page->Title = "Test $class page";
|
||||||
|
|
||||||
$page->write();
|
// $page->write();
|
||||||
$this->assertEquals("Test $class page", DB::query("SELECT \"Title\" FROM \"SiteTree\" WHERE \"ID\" = $page->ID")->value());
|
// $this->assertEquals("Test $class page", DB::query("SELECT \"Title\" FROM \"SiteTree\" WHERE \"ID\" = $page->ID")->value());
|
||||||
|
|
||||||
$page->doPublish();
|
// $page->doPublish();
|
||||||
$this->assertEquals("Test $class page", DB::query("SELECT \"Title\" FROM \"SiteTree_Live\" WHERE \"ID\" = $page->ID")->value());
|
// $this->assertEquals("Test $class page", DB::query("SELECT \"Title\" FROM \"SiteTree_Live\" WHERE \"ID\" = $page->ID")->value());
|
||||||
|
|
||||||
// Check that you can visit the page
|
// // Check that you can visit the page
|
||||||
$this->get($page->URLSegment);
|
// $this->get($page->URLSegment);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -423,11 +423,14 @@ class SiteTreeTest extends SapphireTest {
|
|||||||
* an error
|
* an error
|
||||||
*/
|
*/
|
||||||
public function testReadArchiveDate() {
|
public function testReadArchiveDate() {
|
||||||
Versioned::reading_archived_date('2009-07-02 14:05:07');
|
$date = '2009-07-02 14:05:07';
|
||||||
|
Versioned::reading_archived_date($date);
|
||||||
DataObject::get('SiteTree', "\"ParentID\" = 0");
|
DataObject::get('SiteTree', "\"ParentID\" = 0");
|
||||||
|
|
||||||
Versioned::reading_archived_date(null);
|
Versioned::reading_archived_date(null);
|
||||||
|
$this->assertEquals(
|
||||||
|
Versioned::get_reading_mode(),
|
||||||
|
'Archive.'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testEditPermissions() {
|
public function testEditPermissions() {
|
||||||
|
Loading…
Reference in New Issue
Block a user