public function testChangedPagesFilter()
 {
     $unchangedPage = $this->objFromFixture('Page', 'page1');
     $unchangedPage->doPublish();
     $changedPage = $this->objFromFixture('Page', 'page2');
     $changedPage->Title = 'Original';
     $changedPage->publish('Stage', 'Live');
     $changedPage->Title = 'Changed';
     $changedPage->write();
     // Check that only changed pages are returned
     $f = new CMSSiteTreeFilter_ChangedPages(array('Term' => 'Changed'));
     $results = $f->pagesIncluded();
     $this->assertTrue($f->isPageIncluded($changedPage));
     $this->assertFalse($f->isPageIncluded($unchangedPage));
     $this->assertEquals(1, count($results));
     $this->assertEquals(array('ID' => $changedPage->ID, 'ParentID' => 0), $results[0]);
     // Check that only changed pages are returned
     $f = new CMSSiteTreeFilter_ChangedPages(array('Term' => 'No Matches'));
     $results = $f->pagesIncluded();
     $this->assertEquals(0, count($results));
     // If we roll back to an earlier version than what's on the published site, we should still show the changed
     $changedPage->Title = 'Changed 2';
     $changedPage->publish('Stage', 'Live');
     $changedPage->doRollbackTo(1);
     $f = new CMSSiteTreeFilter_ChangedPages(array('Term' => 'Changed'));
     $results = $f->pagesIncluded();
     $this->assertEquals(1, count($results));
     $this->assertEquals(array('ID' => $changedPage->ID, 'ParentID' => 0), $results[0]);
 }
 function testChangedPagesFilter()
 {
     $unchangedPage = $this->objFromFixture('Page', 'page1');
     $unchangedPage->doPublish();
     $changedPage = $this->objFromFixture('Page', 'page2');
     $changedPage->MetaTitle = 'Original';
     $changedPage->publish('Stage', 'Live');
     $changedPage->MetaTitle = 'Changed';
     $changedPage->write();
     $f = new CMSSiteTreeFilter_ChangedPages();
     $results = $f->pagesIncluded();
     $this->assertTrue($f->isPageIncluded($changedPage));
     $this->assertFalse($f->isPageIncluded($unchangedPage));
     $this->assertEquals(1, count($results));
     $this->assertEquals(array('ID' => $changedPage->ID, 'ParentID' => 0), $results[0]);
 }