mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 09:05:55 +00:00
Removed disabled tests (#29)
They use all kinds of outdated APIs (in test system and CMS controllers), and the function rename makes it unclear that they're actually disabled. These kinds of tests should be performed through Behat anyway.
This commit is contained in:
parent
e6832aadca
commit
0e9c3344ac
@ -25,69 +25,6 @@ class SubsiteAdminTest extends BaseSubsiteTest {
|
|||||||
$this->assertTrue(strpos($response2->getBody(), '<head') !== false, "Testing <head> exists");
|
$this->assertTrue(strpos($response2->getBody(), '<head') !== false, "Testing <head> exists");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Test searching for an intranet
|
|
||||||
*/
|
|
||||||
function XXtestIntranetSearch() {
|
|
||||||
$cont = new SubsiteAdmin();
|
|
||||||
$cont->pushCurrent();
|
|
||||||
$cont->setSession($this->adminLoggedInSession());
|
|
||||||
|
|
||||||
// Check that the logged-in member has the correct permissions
|
|
||||||
$this->assertTrue(Permission::check('ADMIN') ? true : false);
|
|
||||||
|
|
||||||
$form = $cont->SearchForm();
|
|
||||||
|
|
||||||
$searches = array(
|
|
||||||
array('Name' => 'Other'),
|
|
||||||
);
|
|
||||||
|
|
||||||
foreach($searches as $search) {
|
|
||||||
$response = $form->testAjaxSubmission('getResults', $search);
|
|
||||||
$links = $response->getLinks();
|
|
||||||
foreach($links as $link) {
|
|
||||||
$this->assertTrue(preg_match('/^admin\/subsites\/show\/[0-9]+$/', $link['href']) == 1, "Search result links bad.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$cont->popCurrent();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test the intranet creation form.
|
|
||||||
*/
|
|
||||||
function XXtestIntranetCreation() {
|
|
||||||
$cont = new SubsiteAdmin();
|
|
||||||
$cont->pushCurrent();
|
|
||||||
$cont->setSession($this->adminLoggedInSession());
|
|
||||||
|
|
||||||
$form = $cont->AddSubsiteForm();
|
|
||||||
$source = $form->dataFieldByName('TemplateID')->getSource();
|
|
||||||
|
|
||||||
$templateIDs = $this->allFixtureIDs('Subsite');
|
|
||||||
foreach($templateIDs as $templateID) {
|
|
||||||
$this->assertArrayHasKey($templateID, $source);
|
|
||||||
}
|
|
||||||
|
|
||||||
$templateObj = $this->objFromFixture('Subsite','main');
|
|
||||||
$this->assertEquals($templateObj->Title, $source[$templateObj->ID], "Template dropdown isn't listing Title values");
|
|
||||||
|
|
||||||
$response = $form->testSubmission('addintranet', array(
|
|
||||||
'Name' => 'Test Intranet',
|
|
||||||
'Domain' => 'test.example.com',
|
|
||||||
'TemplateID' => 1,
|
|
||||||
'AdminEmail' => '',
|
|
||||||
'AdminName' => '',
|
|
||||||
));
|
|
||||||
|
|
||||||
$this->assertTrue(true == preg_match('/admin\/subsites\/show\/([0-9]+)/i', $response->getHeader('Location'), $matches), "Intranet creation dowsn't redirect to new view");
|
|
||||||
|
|
||||||
$newIntranet = DataObject::get_by_id("Subsite", $matches[1]);
|
|
||||||
$this->assertEquals('Test Intranet', $newIntranet->Title, "New intranet not created properly.");
|
|
||||||
|
|
||||||
$cont->popCurrent();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test that the main-site user with ADMIN permissions can access all subsites, regardless
|
* Test that the main-site user with ADMIN permissions can access all subsites, regardless
|
||||||
|
Loading…
x
Reference in New Issue
Block a user