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
|
||||
*/
|
||||
public function testPublishOneOfEachKindOfPage() {
|
||||
return;
|
||||
$classes = ClassInfo::subclassesFor("SiteTree");
|
||||
array_shift($classes);
|
||||
$this->markTestIncomplete();
|
||||
|
||||
foreach($classes as $class) {
|
||||
$page = new $class();
|
||||
if($class instanceof TestOnly) continue;
|
||||
// $classes = ClassInfo::subclassesFor("SiteTree");
|
||||
// array_shift($classes);
|
||||
|
||||
$page->Title = "Test $class page";
|
||||
// foreach($classes as $class) {
|
||||
// $page = new $class();
|
||||
// if($class instanceof TestOnly) continue;
|
||||
|
||||
$page->write();
|
||||
$this->assertEquals("Test $class page", DB::query("SELECT \"Title\" FROM \"SiteTree\" WHERE \"ID\" = $page->ID")->value());
|
||||
// $page->Title = "Test $class page";
|
||||
|
||||
$page->doPublish();
|
||||
$this->assertEquals("Test $class page", DB::query("SELECT \"Title\" FROM \"SiteTree_Live\" WHERE \"ID\" = $page->ID")->value());
|
||||
// $page->write();
|
||||
// $this->assertEquals("Test $class page", DB::query("SELECT \"Title\" FROM \"SiteTree\" WHERE \"ID\" = $page->ID")->value());
|
||||
|
||||
// Check that you can visit the page
|
||||
$this->get($page->URLSegment);
|
||||
}
|
||||
// $page->doPublish();
|
||||
// $this->assertEquals("Test $class page", DB::query("SELECT \"Title\" FROM \"SiteTree_Live\" WHERE \"ID\" = $page->ID")->value());
|
||||
|
||||
// // Check that you can visit the page
|
||||
// $this->get($page->URLSegment);
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -423,11 +423,14 @@ class SiteTreeTest extends SapphireTest {
|
||||
* an error
|
||||
*/
|
||||
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");
|
||||
|
||||
Versioned::reading_archived_date(null);
|
||||
$this->assertEquals(
|
||||
Versioned::get_reading_mode(),
|
||||
'Archive.'
|
||||
);
|
||||
}
|
||||
|
||||
public function testEditPermissions() {
|
||||
|
Loading…
Reference in New Issue
Block a user