BUGFIX: update unit tests for googlesitemap module for 3.0. MINOR: version bump in README

This commit is contained in:
Will Rossiter 2012-03-26 22:50:30 +13:00
parent 295aba26e6
commit 872fd9b258
3 changed files with 8 additions and 8 deletions

View File

@ -6,7 +6,7 @@
## Requirements
* SilverStripe 2.4
* SilverStripe 3.0
## Documentation
@ -22,5 +22,5 @@ See http://en.wikipedia.org/wiki/Sitemaps for info on this format
## Usage Overview
See docs/en/* for more information about configuring the module.
See docs/en for more information about configuring the module.

View File

@ -102,10 +102,10 @@ class GoogleSitemap extends Controller {
* Adds DataObjects to the existing DataObjectSet with pages from the
* site tree
*
* @return DataObjectSet
* @return ArrayList
*/
protected function addRegisteredDataObjects() {
$output = new DataObjectSet();
$output = new ArrayList();
foreach(self::$google_sitemap_dataobjects as $index => $className) {
$dataObjectSet = DataObject::get($className);
@ -145,7 +145,7 @@ class GoogleSitemap extends Controller {
$pages = Versioned::get_by_stage('SiteTree', 'Live', $filter);
$newPages = new DataObjectSet();
$newPages = new ArrayList();
if($pages) {
foreach($pages as $page) {
@ -235,6 +235,7 @@ class GoogleSitemap extends Controller {
function index($url) {
if(self::$enabled) {
SSViewer::set_source_file_comments(false);
$this->getResponse()->addHeader('Content-Type', 'application/xml; charset="utf-8"');
// But we want to still render.

View File

@ -71,9 +71,8 @@ class GoogleSitemapTest extends FunctionalTest {
function testDecoratorAddsFields() {
$page = $this->objFromFixture('Page', 'Page1');
$fields = $page->getCMSFields();
$tab = $fields->fieldByName('Root')->fieldByName('Content')->fieldByName('GoogleSitemap');
$fields = $page->getSettingsFields();
$tab = $fields->fieldByName('Root')->fieldByName('Settings')->fieldByName('GoogleSitemap');
$this->assertInstanceOf('Tab', $tab);
$this->assertInstanceOf('DropdownField', $tab->fieldByName('Priority'));