mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
a5070b858a
API CHANGE Returning arrays instead of Query resource from CMSSiteTreeFilter->pagesIncluded() MINOR Removed unused LeftAndMain->getMarkingFilter() and CMSMainMarkingFilter, now handled by CMSSiteTreeFilter and CMSMain->SearchTreeForm() ENHANCEMENT Moved 'page tree filter' dropdown logic into an additional option for CMSMain->SearchTreeForm() (originally implemented in r83674) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92938 467b73ca-7a2a-4603-9d3b-597d59a354a9
35 lines
922 B
PHP
35 lines
922 B
PHP
<?php
|
|
class CMSMainSearchTreeFormTest extends FunctionalTest {
|
|
|
|
static $fixture_file = 'cms/tests/CMSMainTest.yml';
|
|
|
|
protected $autoFollowRedirection = false;
|
|
|
|
function testTitleFilter() {
|
|
$this->session()->inst_set('loggedInAs', $this->idFromFixture('Member', 'admin'));
|
|
|
|
$response = $this->get(
|
|
'admin/SearchTreeForm/?' .
|
|
http_build_query(array(
|
|
'Title' => 'Page 1',
|
|
'FilterClass' => 'CMSSiteTreeFilter_Search',
|
|
'action_doSearchTree' => true
|
|
))
|
|
);
|
|
|
|
$titles = $this->getPageTitles();
|
|
$this->assertEquals(count($titles), 1);
|
|
// For some reason the title gets split into two lines
|
|
|
|
$this->assertContains('Page 1', $titles[0]);
|
|
}
|
|
|
|
protected function getPageTitles() {
|
|
$titles = array();
|
|
$links = $this->cssParser()->getBySelector('li.class-Page a');
|
|
if($links) foreach($links as $link) {
|
|
$titles[] = preg_replace('/\n/', ' ', $link->asXML());
|
|
}
|
|
return $titles;
|
|
}
|
|
} |