From e097f6e1a873615344ca027d2f953eea80bfc628 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Tue, 27 Mar 2012 17:04:11 +1300 Subject: [PATCH] MINOR Fixes to method arguments in core classes for E_STRICT support. API CHANGE Remove abstract static function and just use static functions in Authenticator (PHP 5.3+ doesn't support abstract static functions) --- admin/code/LeftAndMain.php | 2 +- admin/code/ModelAdmin.php | 2 +- core/manifest/ClassLoader.php | 2 +- filesystem/File.php | 6 +-- filesystem/Folder.php | 2 +- forms/TreeDropdownField.php | 4 +- model/Aggregate.php | 2 +- model/DataExtension.php | 2 +- model/DataObject.php | 4 +- model/Hierarchy.php | 6 +-- model/Image.php | 4 +- model/SQLQuery.php | 2 +- model/Versioned.php | 2 +- model/fieldtypes/Currency.php | 2 +- model/fieldtypes/Date.php | 2 +- model/fieldtypes/Datetime.php | 2 +- model/fieldtypes/HTMLText.php | 2 +- security/Authenticator.php | 11 ++-- security/Group.php | 2 +- security/Member.php | 2 +- security/PermissionRole.php | 4 +- tests/control/RequestHandlingTest.php | 4 +- tests/forms/FormScaffolderTest.php | 4 +- tests/forms/FormTest.php | 4 +- .../gridfield/GridFieldDetailFormTest.php | 12 ++--- tests/forms/uploadfield/UploadFieldTest.php | 10 ++-- tests/model/AggregateTest.php | 53 ++++++++++--------- tests/model/DataDifferencerTest.php | 6 +-- tests/security/GroupTest.php | 2 +- tests/security/MemberTest.php | 10 ++-- tests/view/SSViewerTest.php | 6 +-- 31 files changed, 93 insertions(+), 85 deletions(-) diff --git a/admin/code/LeftAndMain.php b/admin/code/LeftAndMain.php index 97c471a46..5993c9318 100644 --- a/admin/code/LeftAndMain.php +++ b/admin/code/LeftAndMain.php @@ -322,7 +322,7 @@ class LeftAndMain extends Controller implements PermissionProvider { SSViewer::set_theme(null); } - function handleRequest($request, DataModel $model) { + function handleRequest(SS_HTTPRequest $request, DataModel $model = null) { $title = $this->Title(); $response = parent::handleRequest($request, $model); diff --git a/admin/code/ModelAdmin.php b/admin/code/ModelAdmin.php index 1c5a1834c..131f4e192 100644 --- a/admin/code/ModelAdmin.php +++ b/admin/code/ModelAdmin.php @@ -113,7 +113,7 @@ abstract class ModelAdmin extends LeftAndMain { Requirements::javascript(SAPPHIRE_ADMIN_DIR . '/javascript/ModelAdmin.js'); } - function getEditForm($id = null) { + function getEditForm($id = null, $fields = null) { $list = $this->getList(); $exportButton = new GridFieldExportButton(); $exportButton->setExportColumns($this->getExportFields()); diff --git a/core/manifest/ClassLoader.php b/core/manifest/ClassLoader.php index d91f31861..425fc9da7 100644 --- a/core/manifest/ClassLoader.php +++ b/core/manifest/ClassLoader.php @@ -85,4 +85,4 @@ class SS_ClassLoader { return class_exists($class, false) || $this->getManifest()->getItemPath($class); } -} \ No newline at end of file +} diff --git a/filesystem/File.php b/filesystem/File.php index 92d73e738..4a951b0cb 100644 --- a/filesystem/File.php +++ b/filesystem/File.php @@ -319,7 +319,7 @@ class File extends DataObject { * Returns the fields to power the edit screen of files in the CMS * @return FieldList */ - function getCMSFields() { + function getCMSFields($params = null) { // Preview if($this instanceof Image) { $formattedImage = $this->getFormattedImage('SetWidth', Image::$asset_preview_width); @@ -816,8 +816,8 @@ class File extends DataObject { } } - public function flushCache() { - parent::flushCache(); + public function flushCache($persistant = true) { + parent::flushCache($persistant); self::$cache_file_fields = null; } diff --git a/filesystem/Folder.php b/filesystem/Folder.php index 0a1c698b6..3d540e1b3 100644 --- a/filesystem/Folder.php +++ b/filesystem/Folder.php @@ -406,7 +406,7 @@ class Folder extends File { * You can modify this FieldList by subclassing folder, or by creating a {@link DataExtension} * and implemeting updateCMSFields(FieldList $fields) on that extension. */ - function getCMSFields() { + function getCMSFields($param = null) { // Hide field on root level, which can't be renamed if(!$this->ID || $this->ID === "root") { $titleField = new HiddenField("Name"); diff --git a/forms/TreeDropdownField.php b/forms/TreeDropdownField.php index 73282d113..2f62d7c8e 100644 --- a/forms/TreeDropdownField.php +++ b/forms/TreeDropdownField.php @@ -343,7 +343,7 @@ class TreeDropdownField extends FormField { class TreeDropdownField_Readonly extends TreeDropdownField { protected $readonly = true; - function Field() { + function Field($properties = array()) { $fieldName = $this->labelField; if($this->value) { $keyObj = $this->objectForKey($this->value); @@ -361,4 +361,4 @@ class TreeDropdownField_Readonly extends TreeDropdownField { $field->setForm($this->form); return $field->Field(); } -} \ No newline at end of file +} diff --git a/model/Aggregate.php b/model/Aggregate.php index 77a483db3..e2fd134ff 100644 --- a/model/Aggregate.php +++ b/model/Aggregate.php @@ -90,7 +90,7 @@ class Aggregate extends ViewableData { * This gets the aggregate function * */ - public function XML_val($name, $args) { + public function XML_val($name, $args = null, $cache = false) { $func = strtoupper( strpos($name, 'get') === 0 ? substr($name, 3) : $name ); $attribute = $args ? $args[0] : 'ID'; diff --git a/model/DataExtension.php b/model/DataExtension.php index 614825997..7d8e9c172 100644 --- a/model/DataExtension.php +++ b/model/DataExtension.php @@ -131,7 +131,7 @@ abstract class DataExtension extends Extension { * @return array Returns a map where the keys are db, has_one, etc, and * the values are additional fields/relations to be defined. */ - function extraStatics($class=null, $extension=null) { + function extraStatics($class = null, $extension = null) { return array(); } diff --git a/model/DataObject.php b/model/DataObject.php index 451a9905b..4a5add52a 100644 --- a/model/DataObject.php +++ b/model/DataObject.php @@ -2654,7 +2654,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity * When false will just clear session-local cached data * */ - public function flushCache($persistant=true) { + public function flushCache($persistant = true) { if($persistant) Aggregate::flushCache($this->class); if($this->class == 'DataObject') { @@ -3342,4 +3342,4 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity } } -} \ No newline at end of file +} diff --git a/model/Hierarchy.php b/model/Hierarchy.php index 20b33e49b..b8e988e3f 100644 --- a/model/Hierarchy.php +++ b/model/Hierarchy.php @@ -674,12 +674,12 @@ class Hierarchy extends DataExtension { self::$expanded = array(); self::$treeOpened = array(); } - - function reset() { + + public static function reset() { self::$marked = array(); self::$expanded = array(); self::$treeOpened = array(); } + } - diff --git a/model/Image.php b/model/Image.php index f94ff443c..658bd5898 100644 --- a/model/Image.php +++ b/model/Image.php @@ -73,8 +73,8 @@ class Image extends File { parent::defineMethods(); } - function getCMSFields() { - $fields = parent::getCMSFields(); + function getCMSFields($params = null) { + $fields = parent::getCMSFields($params); $urlLink = "
"; $urlLink .= ""; diff --git a/model/SQLQuery.php b/model/SQLQuery.php index c283474a5..6d66e1cc9 100644 --- a/model/SQLQuery.php +++ b/model/SQLQuery.php @@ -554,7 +554,7 @@ class SQLQuery { * Return the number of rows in this query if the limit were removed. Useful in paged data sets. * @return int */ - function unlimitedRowCount( $column = null) { + function unlimitedRowCount($column = null) { // we can't clear the select if we're relying on its output by a HAVING clause if(count($this->having)) { $records = $this->execute(); diff --git a/model/Versioned.php b/model/Versioned.php index fa446fafb..dc9a62500 100644 --- a/model/Versioned.php +++ b/model/Versioned.php @@ -132,7 +132,7 @@ class Versioned extends DataExtension { * Augment the the SQLQuery that is created by the DataQuery * @todo Should this all go into VersionedDataQuery? */ - function augmentSQL(SQLQuery &$query, DataQuery &$dataQuery) { + function augmentSQL(SQLQuery &$query, DataQuery &$dataQuery = null) { $baseTable = ClassInfo::baseDataClass($dataQuery->dataClass()); switch($dataQuery->getQueryParam('Versioned.mode')) { diff --git a/model/fieldtypes/Currency.php b/model/fieldtypes/Currency.php index 23a10c734..5d0d2b6ec 100644 --- a/model/fieldtypes/Currency.php +++ b/model/fieldtypes/Currency.php @@ -41,7 +41,7 @@ class Currency extends Decimal { else return $val; } - function setValue($value) { + function setValue($value, $record = null) { $matches = null; if(is_numeric($value)) { $this->value = $value; diff --git a/model/fieldtypes/Date.php b/model/fieldtypes/Date.php index 60d3c834f..804fad3a1 100644 --- a/model/fieldtypes/Date.php +++ b/model/fieldtypes/Date.php @@ -20,7 +20,7 @@ */ class Date extends DBField { - function setValue($value) { + function setValue($value, $record = null) { if($value === false || $value === null || (is_string($value) && !strlen($value))) { // don't try to evaluate empty values with strtotime() below, as it returns "1970-01-01" when it should be saved as NULL in database $this->value = null; diff --git a/model/fieldtypes/Datetime.php b/model/fieldtypes/Datetime.php index ac4536877..b655eff5a 100644 --- a/model/fieldtypes/Datetime.php +++ b/model/fieldtypes/Datetime.php @@ -25,7 +25,7 @@ */ class SS_Datetime extends Date { - function setValue($value) { + function setValue($value, $record = null) { if($value === false || $value === null || (is_string($value) && !strlen($value))) { // don't try to evaluate empty values with strtotime() below, as it returns "1970-01-01" when it should be saved as NULL in database $this->value = null; diff --git a/model/fieldtypes/HTMLText.php b/model/fieldtypes/HTMLText.php index 046be3262..b90c98681 100644 --- a/model/fieldtypes/HTMLText.php +++ b/model/fieldtypes/HTMLText.php @@ -136,7 +136,7 @@ class HTMLText extends Text { return new HtmlEditorField($this->name, $title); } - public function scaffoldSearchField($title = null) { + public function scaffoldSearchField($title = null, $params = null) { return new TextField($this->name, $title); } diff --git a/security/Authenticator.php b/security/Authenticator.php index 0a226a89a..0d38b9e1c 100644 --- a/security/Authenticator.php +++ b/security/Authenticator.php @@ -37,9 +37,8 @@ abstract class Authenticator extends Object { * @return bool|Member Returns FALSE if authentication fails, otherwise * the member object */ - public abstract static function authenticate($RAW_data, - Form $form = null); - + public static function authenticate($RAW_data, Form $form = null) { + } /** * Method that creates the login form for this authentication method @@ -49,7 +48,8 @@ abstract class Authenticator extends Object { * @return Form Returns the login form to use with this authentication * method */ - public abstract static function get_login_form(Controller $controller); + public static function get_login_form(Controller $controller) { + } /** @@ -57,7 +57,8 @@ abstract class Authenticator extends Object { * * @return string Returns the name of the authentication method. */ - public abstract static function get_name(); + public static function get_name() { + } public static function register($authenticator) { self::register_authenticator($authenticator); diff --git a/security/Group.php b/security/Group.php index b4b8fde83..ff470aac2 100755 --- a/security/Group.php +++ b/security/Group.php @@ -59,7 +59,7 @@ class Group extends DataObject { * * @return FieldList */ - public function getCMSFields() { + public function getCMSFields($params = null) { Requirements::javascript(SAPPHIRE_DIR . '/javascript/PermissionCheckboxSetField.js'); $fields = new FieldList( diff --git a/security/Member.php b/security/Member.php index b1e12a1c7..e118ae013 100644 --- a/security/Member.php +++ b/security/Member.php @@ -1084,7 +1084,7 @@ class Member extends DataObject implements TemplateGlobalProvider { * @return FieldList Return a FieldList of fields that would appropriate for * editing this member. */ - public function getCMSFields() { + public function getCMSFields($params = null) { require_once('Zend/Date.php'); $fields = parent::getCMSFields(); diff --git a/security/PermissionRole.php b/security/PermissionRole.php index 3f2dd0da1..3c1a00193 100644 --- a/security/PermissionRole.php +++ b/security/PermissionRole.php @@ -33,8 +33,8 @@ class PermissionRole extends DataObject { static $plural_name = 'Roles'; - function getCMSFields() { - $fields = parent::getCMSFields(); + function getCMSFields($params = null) { + $fields = parent::getCMSFields($params); $fields->removeFieldFromTab('Root', 'Codes'); $fields->removeFieldFromTab('Root', 'Groups'); diff --git a/tests/control/RequestHandlingTest.php b/tests/control/RequestHandlingTest.php index 72b62fe88..0454332a5 100644 --- a/tests/control/RequestHandlingTest.php +++ b/tests/control/RequestHandlingTest.php @@ -329,7 +329,7 @@ class RequestHandlingTest_Controller extends Controller implements TestOnly { $this->httpError(404, 'This page does not exist.'); } - public function getViewer(){ + public function getViewer($action) { return new SSViewer('BlankPage'); } } @@ -384,7 +384,7 @@ class RequestHandlingTest_FormActionController extends Controller { return 'formactionInAllowedActions'; } - public function getViewer(){ + public function getViewer($action = null) { return new SSViewer('BlankPage'); } diff --git a/tests/forms/FormScaffolderTest.php b/tests/forms/FormScaffolderTest.php index 365d9d0ac..e95874866 100644 --- a/tests/forms/FormScaffolderTest.php +++ b/tests/forms/FormScaffolderTest.php @@ -128,11 +128,13 @@ class FormScaffolderTest_ArticleExtension extends DataExtension implements TestO static $db = array( 'ExtendedField' => 'Varchar' ); - function updateCMSFields(&$fields) { + + function updateCMSFields(FieldList $fields) { $fields->addFieldToTab('Root.Main', new TextField('AddedExtensionField') ); } + } DataObject::add_extension('FormScaffolderTest_Article', 'FormScaffolderTest_ArticleExtension'); diff --git a/tests/forms/FormTest.php b/tests/forms/FormTest.php index 7ad8565fb..d6e0b5fa7 100644 --- a/tests/forms/FormTest.php +++ b/tests/forms/FormTest.php @@ -468,7 +468,7 @@ class FormTest_Controller extends Controller implements TestOnly { return $this->redirectBack(); } - function getViewer(){ + function getViewer($action = null) { return new SSViewer('BlankPage'); } @@ -505,7 +505,7 @@ class FormTest_ControllerWithSecurityToken extends Controller implements TestOnl return $this->redirectBack(); } - function getViewer(){ + function getViewer($action = null) { return new SSViewer('BlankPage'); } } diff --git a/tests/forms/gridfield/GridFieldDetailFormTest.php b/tests/forms/gridfield/GridFieldDetailFormTest.php index c66a9fe9e..d71655811 100644 --- a/tests/forms/gridfield/GridFieldDetailFormTest.php +++ b/tests/forms/gridfield/GridFieldDetailFormTest.php @@ -140,8 +140,8 @@ class GridFieldDetailFormTest_Person extends DataObject implements TestOnly { 'Categories' => 'GridFieldDetailFormTest_Category' ); - function getCMSFields() { - $fields = parent::getCMSFields(); + function getCMSFields($params = null) { + $fields = parent::getCMSFields($params); // TODO No longer necessary once FormScaffolder uses GridField $fields->replaceField('Categories', Object::create('GridField', 'Categories', 'Categories', @@ -162,8 +162,8 @@ class GridFieldDetailFormTest_PeopleGroup extends DataObject implements TestOnly 'People' => 'GridFieldDetailFormTest_Person' ); - function getCMSFields() { - $fields = parent::getCMSFields(); + function getCMSFields($params = null) { + $fields = parent::getCMSFields($params); // TODO No longer necessary once FormScaffolder uses GridField $fields->replaceField('People', Object::create('GridField', 'People', 'People', @@ -184,8 +184,8 @@ class GridFieldDetailFormTest_Category extends DataObject implements TestOnly { 'People' => 'GridFieldDetailFormTest_Person' ); - function getCMSFields() { - $fields = parent::getCMSFields(); + function getCMSFields($params = null) { + $fields = parent::getCMSFields($params); // TODO No longer necessary once FormScaffolder uses GridField $fields->replaceField('People', Object::create('GridField', 'People', 'People', diff --git a/tests/forms/uploadfield/UploadFieldTest.php b/tests/forms/uploadfield/UploadFieldTest.php index d25231373..0e6cff31b 100644 --- a/tests/forms/uploadfield/UploadFieldTest.php +++ b/tests/forms/uploadfield/UploadFieldTest.php @@ -567,21 +567,21 @@ static $many_many = array( class UploadFieldTest_FileExtension extends DataExtension implements TestOnly { - function extraStatics() { + function extraStatics($class = null, $extension = null) { return array( 'has_one' => array('Record' => 'UploadFieldTest_Record') ); } - function canDelete() { + function canDelete($member = null) { if($this->owner->Name == 'nodelete.txt') return false; } - function canEdit() { + function canEdit($member = null) { if($this->owner->Name == 'noedit.txt') return false; } - function canView() { + function canView($member = null) { if($this->owner->Name == 'noview.txt') return false; } } @@ -655,4 +655,4 @@ class UploadFieldTest_Controller extends Controller implements TestOnly { } -} \ No newline at end of file +} diff --git a/tests/model/AggregateTest.php b/tests/model/AggregateTest.php index 615b59361..2c1dc15bc 100644 --- a/tests/model/AggregateTest.php +++ b/tests/model/AggregateTest.php @@ -73,13 +73,15 @@ class AggregateTest extends SapphireTest { * Test basic aggregation on a passed type */ function testTypeSpecifiedAggregate() { + $foo = $this->objFromFixture('AggregateTest_Foo', 'foo1'); + // Template style access - $this->assertEquals(DataObject::Aggregate('AggregateTest_Foo')->XML_val('Max', array('Foo')), 9); - $this->assertEquals(DataObject::Aggregate('AggregateTest_Fab')->XML_val('Max', array('Fab')), 3); + $this->assertEquals($foo->Aggregate('AggregateTest_Foo')->XML_val('Max', array('Foo')), 9); + $this->assertEquals($foo->Aggregate('AggregateTest_Fab')->XML_val('Max', array('Fab')), 3); // PHP style access - $this->assertEquals(DataObject::Aggregate('AggregateTest_Foo')->Max('Foo'), 9); - $this->assertEquals(DataObject::Aggregate('AggregateTest_Fab')->Max('Fab'), 3); + $this->assertEquals($foo->Aggregate('AggregateTest_Foo')->Max('Foo'), 9); + $this->assertEquals($foo->Aggregate('AggregateTest_Fab')->Max('Fab'), 3); } /* */ @@ -90,7 +92,7 @@ class AggregateTest extends SapphireTest { function testAutoTypeAggregate() { $foo = $this->objFromFixture('AggregateTest_Foo', 'foo1'); $fab = $this->objFromFixture('AggregateTest_Fab', 'fab1'); - + // Template style access $this->assertEquals($foo->Aggregate()->XML_val('Max', array('Foo')), 9); $this->assertEquals($fab->Aggregate()->XML_val('Max', array('Fab')), 3); @@ -106,13 +108,15 @@ class AggregateTest extends SapphireTest { * @return unknown_type */ function testBaseFieldAggregate() { + $foo = $this->objFromFixture('AggregateTest_Foo', 'foo1'); + $this->assertEquals( - $this->formatDate(DataObject::Aggregate('AggregateTest_Foo')->Max('LastEdited')), + $this->formatDate($foo->Aggregate('AggregateTest_Foo')->Max('LastEdited')), $this->formatDate(DataObject::get_one('AggregateTest_Foo', '', '', '"LastEdited" DESC')->LastEdited) ); $this->assertEquals( - $this->formatDate(DataObject::Aggregate('AggregateTest_Foo')->Max('Created')), + $this->formatDate($foo->Aggregate('AggregateTest_Foo')->Max('Created')), $this->formatDate(DataObject::get_one('AggregateTest_Foo', '', '', '"Created" DESC')->Created) ); } @@ -122,13 +126,14 @@ class AggregateTest extends SapphireTest { * Test aggregation takes place on the passed type & it's children only */ function testChildAggregate() { - + $foo = $this->objFromFixture('AggregateTest_Foo', 'foo1'); + // For base classes, aggregate is calculcated on it and all children classes - $this->assertEquals(DataObject::Aggregate('AggregateTest_Foo')->Max('Foo'), 9); + $this->assertEquals($foo->Aggregate('AggregateTest_Foo')->Max('Foo'), 9); // For subclasses, aggregate is calculated for that subclass and it's children only - $this->assertEquals(DataObject::Aggregate('AggregateTest_Fab')->Max('Foo'), 9); - $this->assertEquals(DataObject::Aggregate('AggregateTest_Fac')->Max('Foo'), 6); + $this->assertEquals($foo->Aggregate('AggregateTest_Fab')->Max('Foo'), 9); + $this->assertEquals($foo->Aggregate('AggregateTest_Fac')->Max('Foo'), 6); } /* */ @@ -145,35 +150,35 @@ class AggregateTest extends SapphireTest { * Test cache is correctly flushed on write */ function testCacheFlushing() { - + $foo = $this->objFromFixture('AggregateTest_Foo', 'foo1'); + $fab = $this->objFromFixture('AggregateTest_Fab', 'fab1'); + // For base classes, aggregate is calculcated on it and all children classes - $this->assertEquals(DataObject::Aggregate('AggregateTest_Foo')->Max('Foo'), 9); + $this->assertEquals($fab->Aggregate('AggregateTest_Foo')->Max('Foo'), 9); // For subclasses, aggregate is calculated for that subclass and it's children only - $this->assertEquals(DataObject::Aggregate('AggregateTest_Fab')->Max('Foo'), 9); - $this->assertEquals(DataObject::Aggregate('AggregateTest_Fac')->Max('Foo'), 6); - - $foo = $this->objFromFixture('AggregateTest_Foo', 'foo1'); + $this->assertEquals($fab->Aggregate('AggregateTest_Fab')->Max('Foo'), 9); + $this->assertEquals($fab->Aggregate('AggregateTest_Fac')->Max('Foo'), 6); + $foo->Foo = 12; $foo->write(); // For base classes, aggregate is calculcated on it and all children classes - $this->assertEquals(DataObject::Aggregate('AggregateTest_Foo')->Max('Foo'), 12); + $this->assertEquals($fab->Aggregate('AggregateTest_Foo')->Max('Foo'), 12); // For subclasses, aggregate is calculated for that subclass and it's children only - $this->assertEquals(DataObject::Aggregate('AggregateTest_Fab')->Max('Foo'), 9); - $this->assertEquals(DataObject::Aggregate('AggregateTest_Fac')->Max('Foo'), 6); + $this->assertEquals($fab->Aggregate('AggregateTest_Fab')->Max('Foo'), 9); + $this->assertEquals($fab->Aggregate('AggregateTest_Fac')->Max('Foo'), 6); - $fab = $this->objFromFixture('AggregateTest_Fab', 'fab1'); $fab->Foo = 15; $fab->write(); // For base classes, aggregate is calculcated on it and all children classes - $this->assertEquals(DataObject::Aggregate('AggregateTest_Foo')->Max('Foo'), 15); + $this->assertEquals($fab->Aggregate('AggregateTest_Foo')->Max('Foo'), 15); // For subclasses, aggregate is calculated for that subclass and it's children only - $this->assertEquals(DataObject::Aggregate('AggregateTest_Fab')->Max('Foo'), 15); - $this->assertEquals(DataObject::Aggregate('AggregateTest_Fac')->Max('Foo'), 6); + $this->assertEquals($fab->Aggregate('AggregateTest_Fab')->Max('Foo'), 15); + $this->assertEquals($fab->Aggregate('AggregateTest_Fac')->Max('Foo'), 6); } /* */ diff --git a/tests/model/DataDifferencerTest.php b/tests/model/DataDifferencerTest.php index c2cee4898..443173fc9 100644 --- a/tests/model/DataDifferencerTest.php +++ b/tests/model/DataDifferencerTest.php @@ -62,8 +62,8 @@ class DataDifferencerTest_Object extends DataObject implements TestOnly { 'HasOneRelation' => 'DataDifferencerTest_HasOneRelationObject' ); - function getCMSFields() { - $fields = parent::getCMSFields(); + function getCMSFields($params = null) { + $fields = parent::getCMSFields($params); $choices = array( 'a' => 'a', 'b' => 'b', @@ -103,4 +103,4 @@ class DataDifferencerTest_MockImage extends Image implements TestOnly { // Skip aktual generation return $gd; } -} \ No newline at end of file +} diff --git a/tests/security/GroupTest.php b/tests/security/GroupTest.php index b3e0c08ec..9e970926a 100644 --- a/tests/security/GroupTest.php +++ b/tests/security/GroupTest.php @@ -132,7 +132,7 @@ class GroupTest extends FunctionalTest { class GroupTest_Member extends Member implements TestOnly { - function getCMSFields() { + function getCMSFields($params = null) { $groups = DataObject::get('Group'); $groupsMap = ($groups) ? $groups->map() : false; $fields = new FieldList( diff --git a/tests/security/MemberTest.php b/tests/security/MemberTest.php index b485aecd0..5e8656760 100644 --- a/tests/security/MemberTest.php +++ b/tests/security/MemberTest.php @@ -591,29 +591,29 @@ class MemberTest extends FunctionalTest { } class MemberTest_ViewingAllowedExtension extends DataExtension implements TestOnly { - public function canView() { + public function canView($member = null) { return true; } } class MemberTest_ViewingDeniedExtension extends DataExtension implements TestOnly { - public function canView() { + public function canView($member = null) { return false; } } class MemberTest_EditingAllowedDeletingDeniedExtension extends DataExtension implements TestOnly { - public function canView() { + public function canView($member = null) { return true; } - public function canEdit() { + public function canEdit($member = null) { return true; } - public function canDelete() { + public function canDelete($member = null) { return false; } diff --git a/tests/view/SSViewerTest.php b/tests/view/SSViewerTest.php index c68d6d219..df0b6ecba 100644 --- a/tests/view/SSViewerTest.php +++ b/tests/view/SSViewerTest.php @@ -930,7 +930,7 @@ class SSViewerTestFixture extends ViewableData { } - function XML_val($fieldName, $arguments = null) { + function XML_val($fieldName, $arguments = null, $cache = false) { if(preg_match('/NotSet/i', $fieldName)) { return ''; } else if(preg_match('/Raw/i', $fieldName)) { @@ -940,7 +940,7 @@ class SSViewerTestFixture extends ViewableData { } } - function hasValue($fieldName, $arguments = null) { + function hasValue($fieldName, $arguments = null, $cache = true) { return (bool)$this->XML_val($fieldName, $arguments); } } @@ -1021,4 +1021,4 @@ class SSViewerTest_GlobalProvider implements TemplateGlobalProvider, TestOnly { return 'z' . implode(':', $args) . 'z'; } -} \ No newline at end of file +}