2008-08-12 04:59:27 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class CMSMainTest extends SapphireTest {
|
|
|
|
static $fixture_file = 'cms/tests/CMSMainTest.yml';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @todo Test the results of a publication better
|
|
|
|
*/
|
|
|
|
function testPublish() {
|
|
|
|
$session = new Session(array(
|
|
|
|
'loggedInAs' => $this->idFromFixture('Member', 'admin')
|
|
|
|
));
|
|
|
|
|
2008-08-13 09:54:34 +02:00
|
|
|
$response = Director::test("admin/cms/publishall", array('confirm' => 1), $session);
|
2008-08-27 10:23:47 +02:00
|
|
|
$this->assertContains('Done: Published 5 pages', $response->getBody());
|
2008-08-12 04:59:27 +02:00
|
|
|
|
2008-08-13 09:54:34 +02:00
|
|
|
$response = Director::test("admin/cms/publishitems", array('csvIDs' => '1,2', 'ajax' => 1), $session);
|
2008-08-12 04:59:27 +02:00
|
|
|
$this->assertContains('setNodeTitle(1, \'Page 1\');', $response->getBody());
|
|
|
|
$this->assertContains('setNodeTitle(2, \'Page 2\');', $response->getBody());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//$this->assertRegexp('/Done: Published 4 pages/', $response->getBody())
|
|
|
|
|
|
|
|
/*
|
|
|
|
$response = Director::test("admin/publishitems", array(
|
|
|
|
'ID' => ''
|
|
|
|
'Title' => ''
|
|
|
|
'action_publish' => 'Save and publish',
|
|
|
|
), $session);
|
|
|
|
$this->assertRegexp('/Done: Published 4 pages/', $response->getBody())
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|