Skip to content
This repository
Browse code

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)
  • Loading branch information...
commit e097f6e1a873615344ca027d2f953eea80bfc628 1 parent 86b805d
Sean Harvey authored March 27, 2012 halkyon committed March 28, 2012

Showing 31 changed files with 93 additions and 85 deletions. Show diff stats Hide diff stats

  1. 2  admin/code/LeftAndMain.php
  2. 2  admin/code/ModelAdmin.php
  3. 2  core/manifest/ClassLoader.php
  4. 6  filesystem/File.php
  5. 2  filesystem/Folder.php
  6. 4  forms/TreeDropdownField.php
  7. 2  model/Aggregate.php
  8. 2  model/DataExtension.php
  9. 4  model/DataObject.php
  10. 6  model/Hierarchy.php
  11. 4  model/Image.php
  12. 2  model/SQLQuery.php
  13. 2  model/Versioned.php
  14. 2  model/fieldtypes/Currency.php
  15. 2  model/fieldtypes/Date.php
  16. 2  model/fieldtypes/Datetime.php
  17. 2  model/fieldtypes/HTMLText.php
  18. 11  security/Authenticator.php
  19. 2  security/Group.php
  20. 2  security/Member.php
  21. 4  security/PermissionRole.php
  22. 4  tests/control/RequestHandlingTest.php
  23. 4  tests/forms/FormScaffolderTest.php
  24. 4  tests/forms/FormTest.php
  25. 12  tests/forms/gridfield/GridFieldDetailFormTest.php
  26. 10  tests/forms/uploadfield/UploadFieldTest.php
  27. 53  tests/model/AggregateTest.php
  28. 6  tests/model/DataDifferencerTest.php
  29. 2  tests/security/GroupTest.php
  30. 10  tests/security/MemberTest.php
  31. 6  tests/view/SSViewerTest.php
2  admin/code/LeftAndMain.php
@@ -322,7 +322,7 @@ function init() {
322 322
 		SSViewer::set_theme(null);
323 323
 	}
324 324
 	
325  
-	function handleRequest($request, DataModel $model) {
  325
+	function handleRequest(SS_HTTPRequest $request, DataModel $model = null) {
326 326
 		$title = $this->Title();
327 327
 		
328 328
 		$response = parent::handleRequest($request, $model);
2  admin/code/ModelAdmin.php
@@ -113,7 +113,7 @@ public function init() {
113 113
 		Requirements::javascript(SAPPHIRE_ADMIN_DIR . '/javascript/ModelAdmin.js');
114 114
 	}
115 115
 
116  
-	function getEditForm($id = null) {
  116
+	function getEditForm($id = null, $fields = null) {
117 117
 		$list = $this->getList();
118 118
 		$exportButton = new GridFieldExportButton();
119 119
 		$exportButton->setExportColumns($this->getExportFields());
2  core/manifest/ClassLoader.php
@@ -85,4 +85,4 @@ public function classExists($class) {
85 85
 		return class_exists($class, false) || $this->getManifest()->getItemPath($class);
86 86
 	}
87 87
 
88  
-}
  88
+}
6  filesystem/File.php
@@ -319,7 +319,7 @@ function canDelete($member = null) {
319 319
 	 * Returns the fields to power the edit screen of files in the CMS
320 320
 	 * @return FieldList
321 321
 	 */
322  
-	function getCMSFields() {
  322
+	function getCMSFields($params = null) {
323 323
 		// Preview
324 324
 		if($this instanceof Image) {
325 325
 			$formattedImage = $this->getFormattedImage('SetWidth', Image::$asset_preview_width);
@@ -816,8 +816,8 @@ function getAbsoluteSize(){
816 816
 		}
817 817
 	}
818 818
 	
819  
-	public function flushCache() {
820  
-		parent::flushCache();
  819
+	public function flushCache($persistant = true) {
  820
+		parent::flushCache($persistant);
821 821
 		
822 822
 		self::$cache_file_fields = null;
823 823
 	}
2  filesystem/Folder.php
@@ -406,7 +406,7 @@ public function updateFilesystem() {
406 406
 	 * You can modify this FieldList by subclassing folder, or by creating a {@link DataExtension}
407 407
 	 * and implemeting updateCMSFields(FieldList $fields) on that extension.
408 408
 	 */
409  
-	function getCMSFields() {
  409
+	function getCMSFields($param = null) {
410 410
 		// Hide field on root level, which can't be renamed
411 411
 		if(!$this->ID || $this->ID === "root") {
412 412
 			$titleField = new HiddenField("Name");	
4  forms/TreeDropdownField.php
@@ -343,7 +343,7 @@ function performReadonlyTransformation() {
343 343
 class TreeDropdownField_Readonly extends TreeDropdownField {
344 344
 	protected $readonly = true;
345 345
 	
346  
-	function Field() {
  346
+	function Field($properties = array()) {
347 347
 		$fieldName = $this->labelField;
348 348
 		if($this->value) {
349 349
 			$keyObj = $this->objectForKey($this->value);
@@ -361,4 +361,4 @@ function Field() {
361 361
 		$field->setForm($this->form);
362 362
 		return $field->Field();
363 363
 	}
364  
-}
  364
+}
2  model/Aggregate.php
@@ -90,7 +90,7 @@ protected function query($attr) {
90 90
 	 * This gets the aggregate function 
91 91
 	 * 
92 92
 	 */
93  
-	public function XML_val($name, $args) {
  93
+	public function XML_val($name, $args = null, $cache = false) {
94 94
 		$func = strtoupper( strpos($name, 'get') === 0 ? substr($name, 3) : $name );
95 95
 		$attribute = $args ? $args[0] : 'ID';
96 96
 		
2  model/DataExtension.php
@@ -131,7 +131,7 @@ function canCreate($member) {
131 131
 	 * @return array Returns a map where the keys are db, has_one, etc, and
132 132
 	 *               the values are additional fields/relations to be defined.
133 133
 	 */
134  
-	function extraStatics($class=null, $extension=null) {
  134
+	function extraStatics($class = null, $extension = null) {
135 135
 		return array();
136 136
 	}
137 137
 	
4  model/DataObject.php
@@ -2654,7 +2654,7 @@ public static function get_one($callerClass, $filter = "", $cache = true, $order
2654 2654
 	 *                            When false will just clear session-local cached data 
2655 2655
 	 * 
2656 2656
 	 */
2657  
-	public function flushCache($persistant=true) {
  2657
+	public function flushCache($persistant = true) {
2658 2658
 		if($persistant) Aggregate::flushCache($this->class);
2659 2659
 		
2660 2660
 		if($this->class == 'DataObject') {
@@ -3342,4 +3342,4 @@ function hasValue($field, $arguments = null, $cache = true) {
3342 3342
  		}
3343 3343
  	}
3344 3344
 
3345  
-}
  3345
+}
6  model/Hierarchy.php
@@ -674,12 +674,12 @@ function flushCache() {
674 674
 		self::$expanded = array();
675 675
 		self::$treeOpened = array();
676 676
 	}
677  
-	
678  
-	function reset() {
  677
+
  678
+	public static function reset() {
679 679
 		self::$marked = array();
680 680
 		self::$expanded = array();
681 681
 		self::$treeOpened = array();
682 682
 	}
683  
-}
684 683
 
  684
+}
685 685
 
4  model/Image.php
@@ -73,8 +73,8 @@ public function defineMethods() {
73 73
 		parent::defineMethods();
74 74
 	}
75 75
 
76  
-	function getCMSFields() {
77  
-		$fields = parent::getCMSFields();
  76
+	function getCMSFields($params = null) {
  77
+		$fields = parent::getCMSFields($params);
78 78
 
79 79
 		$urlLink = "<div class='field readonly'>";
80 80
 		$urlLink .= "<label class='left'>"._t('AssetTableField.URL','URL')."</label>";
2  model/SQLQuery.php
@@ -554,7 +554,7 @@ function filtersOnFK() {
554 554
 	 * Return the number of rows in this query if the limit were removed.  Useful in paged data sets. 
555 555
 	 * @return int 
556 556
 	 */ 
557  
-	function unlimitedRowCount( $column = null) {
  557
+	function unlimitedRowCount($column = null) {
558 558
 		// we can't clear the select if we're relying on its output by a HAVING clause
559 559
 		if(count($this->having)) {
560 560
 			$records = $this->execute();
2  model/Versioned.php
@@ -132,7 +132,7 @@ function augmentDataQueryCreation(SQLQuery &$query, DataQuery &$dataQuery) {
132 132
 	 * Augment the the SQLQuery that is created by the DataQuery
133 133
 	 * @todo Should this all go into VersionedDataQuery?
134 134
 	 */
135  
-	function augmentSQL(SQLQuery &$query, DataQuery &$dataQuery) {
  135
+	function augmentSQL(SQLQuery &$query, DataQuery &$dataQuery = null) {
136 136
 	    $baseTable = ClassInfo::baseDataClass($dataQuery->dataClass());
137 137
 	    
138 138
 		switch($dataQuery->getQueryParam('Versioned.mode')) {
2  model/fieldtypes/Currency.php
@@ -41,7 +41,7 @@ function Whole() {
41 41
 		else return $val;
42 42
 	}
43 43
 	
44  
-	function setValue($value) {
  44
+	function setValue($value, $record = null) {
45 45
 		$matches = null;
46 46
 		if(is_numeric($value)) {
47 47
 			$this->value = $value;
2  model/fieldtypes/Date.php
@@ -20,7 +20,7 @@
20 20
  */
21 21
 class Date extends DBField {
22 22
 	
23  
-	function setValue($value) {
  23
+	function setValue($value, $record = null) {
24 24
 		if($value === false || $value === null || (is_string($value) && !strlen($value))) {
25 25
 			// 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
26 26
 			$this->value = null;
2  model/fieldtypes/Datetime.php
@@ -25,7 +25,7 @@
25 25
  */
26 26
 class SS_Datetime extends Date {
27 27
 	
28  
-	function setValue($value) {
  28
+	function setValue($value, $record = null) {
29 29
 		if($value === false || $value === null || (is_string($value) && !strlen($value))) {
30 30
 			// 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
31 31
 			$this->value = null;
2  model/fieldtypes/HTMLText.php
@@ -136,7 +136,7 @@ public function scaffoldFormField($title = null, $params = null) {
136 136
 		return new HtmlEditorField($this->name, $title);
137 137
 	}
138 138
 	
139  
-	public function scaffoldSearchField($title = null) {
  139
+	public function scaffoldSearchField($title = null, $params = null) {
140 140
 		return new TextField($this->name, $title);
141 141
 	}
142 142
 
11  security/Authenticator.php
@@ -37,9 +37,8 @@
37 37
    * @return bool|Member Returns FALSE if authentication fails, otherwise
38 38
    *                     the member object
39 39
    */
40  
-  public abstract static function authenticate($RAW_data,
41  
-                                               Form $form = null);
42  
-
  40
+	public static function authenticate($RAW_data, Form $form = null) {
  41
+	}
43 42
 
44 43
   /**
45 44
    * Method that creates the login form for this authentication method
@@ -49,7 +48,8 @@
49 48
    * @return Form Returns the login form to use with this authentication
50 49
    *              method
51 50
    */
52  
-  public abstract static function get_login_form(Controller $controller);
  51
+	public static function get_login_form(Controller $controller) {
  52
+	}
53 53
 
54 54
 
55 55
   /**
@@ -57,7 +57,8 @@
57 57
    *
58 58
    * @return string Returns the name of the authentication method.
59 59
    */
60  
-  public abstract static function get_name();
  60
+	public static function get_name() {
  61
+	}
61 62
 
62 63
   public static function register($authenticator) {
63 64
 	self::register_authenticator($authenticator);	
2  security/Group.php
@@ -59,7 +59,7 @@ function getAllChildren() {
59 59
 	 *
60 60
 	 * @return FieldList
61 61
 	 */
62  
-	public function getCMSFields() {
  62
+	public function getCMSFields($params = null) {
63 63
 		Requirements::javascript(SAPPHIRE_DIR . '/javascript/PermissionCheckboxSetField.js');
64 64
 		
65 65
 		$fields = new FieldList(
2  security/Member.php
@@ -1084,7 +1084,7 @@ public function memberNotInGroups($groupList, $memberGroups = null){
1084 1084
 	 * @return FieldList Return a FieldList of fields that would appropriate for
1085 1085
 	 *                  editing this member.
1086 1086
 	 */
1087  
-	public function getCMSFields() {
  1087
+	public function getCMSFields($params = null) {
1088 1088
 		require_once('Zend/Date.php');
1089 1089
 		
1090 1090
 		$fields = parent::getCMSFields();
4  security/PermissionRole.php
@@ -33,8 +33,8 @@ class PermissionRole extends DataObject {
33 33
 
34 34
 	static $plural_name = 'Roles';
35 35
 	
36  
-	function getCMSFields() {
37  
-		$fields = parent::getCMSFields();
  36
+	function getCMSFields($params = null) {
  37
+		$fields = parent::getCMSFields($params);
38 38
 		
39 39
 		$fields->removeFieldFromTab('Root', 'Codes');
40 40
 		$fields->removeFieldFromTab('Root', 'Groups');
4  tests/control/RequestHandlingTest.php
@@ -329,7 +329,7 @@ public function throwhttperror() {
329 329
 		$this->httpError(404, 'This page does not exist.');
330 330
 	}
331 331
 
332  
-	public function getViewer(){
  332
+	public function getViewer($action) {
333 333
 		return new SSViewer('BlankPage');
334 334
 	}
335 335
 }
@@ -384,7 +384,7 @@ function formactionInAllowedActions($data, $form = null) {
384 384
 		return 'formactionInAllowedActions';
385 385
 	}
386 386
 
387  
-	public function getViewer(){
  387
+	public function getViewer($action = null) {
388 388
 		return new SSViewer('BlankPage');
389 389
 	}
390 390
 
4  tests/forms/FormScaffolderTest.php
@@ -128,11 +128,13 @@ class FormScaffolderTest_ArticleExtension extends DataExtension implements TestO
128 128
 	static $db = array(
129 129
 		'ExtendedField' => 'Varchar'
130 130
 	);
131  
-	function updateCMSFields(&$fields) {
  131
+
  132
+	function updateCMSFields(FieldList $fields) {
132 133
 		$fields->addFieldToTab('Root.Main',
133 134
 			new TextField('AddedExtensionField')
134 135
 		);
135 136
 	}
  137
+
136 138
 }
137 139
 
138 140
 DataObject::add_extension('FormScaffolderTest_Article', 'FormScaffolderTest_ArticleExtension');
4  tests/forms/FormTest.php
@@ -468,7 +468,7 @@ function doSubmit($data, $form, $request) {
468 468
 		return $this->redirectBack();
469 469
 	}
470 470
 
471  
-	function getViewer(){
  471
+	function getViewer($action = null) {
472 472
 		return new SSViewer('BlankPage');
473 473
 	}
474 474
 
@@ -505,7 +505,7 @@ function doSubmit($data, $form, $request) {
505 505
 		return $this->redirectBack();
506 506
 	}
507 507
 
508  
-	function getViewer(){
  508
+	function getViewer($action = null) {
509 509
 		return new SSViewer('BlankPage');
510 510
 	}
511 511
 }
12  tests/forms/gridfield/GridFieldDetailFormTest.php
@@ -140,8 +140,8 @@ class GridFieldDetailFormTest_Person extends DataObject implements TestOnly {
140 140
 		'Categories' => 'GridFieldDetailFormTest_Category'
141 141
 	);
142 142
 
143  
-	function getCMSFields() {
144  
-		$fields = parent::getCMSFields();
  143
+	function getCMSFields($params = null) {
  144
+		$fields = parent::getCMSFields($params);
145 145
 		// TODO No longer necessary once FormScaffolder uses GridField
146 146
 		$fields->replaceField('Categories',
147 147
 			Object::create('GridField', 'Categories', 'Categories',
@@ -162,8 +162,8 @@ class GridFieldDetailFormTest_PeopleGroup extends DataObject implements TestOnly
162 162
 		'People' => 'GridFieldDetailFormTest_Person'
163 163
 	);
164 164
 	
165  
-	function getCMSFields() {
166  
-		$fields = parent::getCMSFields();
  165
+	function getCMSFields($params = null) {
  166
+		$fields = parent::getCMSFields($params);
167 167
 		// TODO No longer necessary once FormScaffolder uses GridField
168 168
 		$fields->replaceField('People',
169 169
 			Object::create('GridField', 'People', 'People',
@@ -184,8 +184,8 @@ class GridFieldDetailFormTest_Category extends DataObject implements TestOnly {
184 184
 		'People' => 'GridFieldDetailFormTest_Person'
185 185
 	);
186 186
 
187  
-	function getCMSFields() {
188  
-		$fields = parent::getCMSFields();
  187
+	function getCMSFields($params = null) {
  188
+		$fields = parent::getCMSFields($params);
189 189
 		// TODO No longer necessary once FormScaffolder uses GridField
190 190
 		$fields->replaceField('People',
191 191
 			Object::create('GridField', 'People', 'People',
10  tests/forms/uploadfield/UploadFieldTest.php
@@ -567,21 +567,21 @@ class UploadFieldTest_Record extends DataObject implements TestOnly {
567 567
 
568 568
 class UploadFieldTest_FileExtension extends DataExtension implements TestOnly {
569 569
 
570  
-	function extraStatics() {
  570
+	function extraStatics($class = null, $extension = null) {
571 571
 		return array(
572 572
 			'has_one' => array('Record' => 'UploadFieldTest_Record')
573 573
  		);
574 574
 	}
575 575
 
576  
-	function canDelete() {
  576
+	function canDelete($member = null) {
577 577
 		if($this->owner->Name == 'nodelete.txt') return false;
578 578
 	}
579 579
 
580  
-	function canEdit() {
  580
+	function canEdit($member = null) {
581 581
 		if($this->owner->Name == 'noedit.txt') return false;
582 582
 	}
583 583
 
584  
-	function canView() {
  584
+	function canView($member = null) {
585 585
 		if($this->owner->Name == 'noview.txt') return false;
586 586
 	}
587 587
 }
@@ -655,4 +655,4 @@ function submit($data, $form) {
655 655
 		
656 656
 	}
657 657
 
658  
-}
  658
+}
53  tests/model/AggregateTest.php
@@ -73,13 +73,15 @@ function tearDown() {
73 73
 	 * Test basic aggregation on a passed type
74 74
 	 */
75 75
 	function testTypeSpecifiedAggregate() {
  76
+		$foo = $this->objFromFixture('AggregateTest_Foo', 'foo1');
  77
+
76 78
 		// Template style access
77  
-		$this->assertEquals(DataObject::Aggregate('AggregateTest_Foo')->XML_val('Max', array('Foo')), 9);
78  
-		$this->assertEquals(DataObject::Aggregate('AggregateTest_Fab')->XML_val('Max', array('Fab')), 3);
  79
+		$this->assertEquals($foo->Aggregate('AggregateTest_Foo')->XML_val('Max', array('Foo')), 9);
  80
+		$this->assertEquals($foo->Aggregate('AggregateTest_Fab')->XML_val('Max', array('Fab')), 3);
79 81
 
80 82
 		// PHP style access
81  
-		$this->assertEquals(DataObject::Aggregate('AggregateTest_Foo')->Max('Foo'), 9);
82  
-		$this->assertEquals(DataObject::Aggregate('AggregateTest_Fab')->Max('Fab'), 3);
  83
+		$this->assertEquals($foo->Aggregate('AggregateTest_Foo')->Max('Foo'), 9);
  84
+		$this->assertEquals($foo->Aggregate('AggregateTest_Fab')->Max('Fab'), 3);
83 85
 	}
84 86
 	/* */
85 87
 	
@@ -90,7 +92,7 @@ function testTypeSpecifiedAggregate() {
90 92
 	function testAutoTypeAggregate() {
91 93
 		$foo = $this->objFromFixture('AggregateTest_Foo', 'foo1');
92 94
 		$fab = $this->objFromFixture('AggregateTest_Fab', 'fab1');
93  
-		
  95
+
94 96
 		// Template style access
95 97
 		$this->assertEquals($foo->Aggregate()->XML_val('Max', array('Foo')), 9);
96 98
 		$this->assertEquals($fab->Aggregate()->XML_val('Max', array('Fab')), 3);
@@ -106,13 +108,15 @@ function testAutoTypeAggregate() {
106 108
 	 * @return unknown_type
107 109
 	 */
108 110
 	function testBaseFieldAggregate() {
  111
+		$foo = $this->objFromFixture('AggregateTest_Foo', 'foo1');
  112
+
109 113
 		$this->assertEquals(
110  
-			$this->formatDate(DataObject::Aggregate('AggregateTest_Foo')->Max('LastEdited')),
  114
+			$this->formatDate($foo->Aggregate('AggregateTest_Foo')->Max('LastEdited')),
111 115
 			$this->formatDate(DataObject::get_one('AggregateTest_Foo', '', '', '"LastEdited" DESC')->LastEdited)
112 116
 		);
113 117
 		
114 118
 		$this->assertEquals(
115  
-			$this->formatDate(DataObject::Aggregate('AggregateTest_Foo')->Max('Created')),
  119
+			$this->formatDate($foo->Aggregate('AggregateTest_Foo')->Max('Created')),
116 120
 			$this->formatDate(DataObject::get_one('AggregateTest_Foo', '', '', '"Created" DESC')->Created)
117 121
 		);
118 122
 	}
@@ -122,13 +126,14 @@ function testBaseFieldAggregate() {
122 126
 	 * Test aggregation takes place on the passed type & it's children only
123 127
 	 */
124 128
 	function testChildAggregate() {
125  
-		
  129
+		$foo = $this->objFromFixture('AggregateTest_Foo', 'foo1');
  130
+	
126 131
 		// For base classes, aggregate is calculcated on it and all children classes
127  
-		$this->assertEquals(DataObject::Aggregate('AggregateTest_Foo')->Max('Foo'), 9);
  132
+		$this->assertEquals($foo->Aggregate('AggregateTest_Foo')->Max('Foo'), 9);
128 133
 
129 134
 		// For subclasses, aggregate is calculated for that subclass and it's children only
130  
-		$this->assertEquals(DataObject::Aggregate('AggregateTest_Fab')->Max('Foo'), 9);
131  
-		$this->assertEquals(DataObject::Aggregate('AggregateTest_Fac')->Max('Foo'), 6);
  135
+		$this->assertEquals($foo->Aggregate('AggregateTest_Fab')->Max('Foo'), 9);
  136
+		$this->assertEquals($foo->Aggregate('AggregateTest_Fac')->Max('Foo'), 6);
132 137
 		
133 138
 	}
134 139
 	/* */
@@ -145,35 +150,35 @@ function testCache() {
145 150
 	 * Test cache is correctly flushed on write
146 151
 	 */
147 152
 	function testCacheFlushing() {
148  
-		
  153
+		$foo = $this->objFromFixture('AggregateTest_Foo', 'foo1');
  154
+		$fab = $this->objFromFixture('AggregateTest_Fab', 'fab1');
  155
+
149 156
 		// For base classes, aggregate is calculcated on it and all children classes
150  
-		$this->assertEquals(DataObject::Aggregate('AggregateTest_Foo')->Max('Foo'), 9);
  157
+		$this->assertEquals($fab->Aggregate('AggregateTest_Foo')->Max('Foo'), 9);
151 158
 
152 159
 		// For subclasses, aggregate is calculated for that subclass and it's children only
153  
-		$this->assertEquals(DataObject::Aggregate('AggregateTest_Fab')->Max('Foo'), 9);
154  
-		$this->assertEquals(DataObject::Aggregate('AggregateTest_Fac')->Max('Foo'), 6);
155  
-		
156  
-		$foo = $this->objFromFixture('AggregateTest_Foo', 'foo1');
  160
+		$this->assertEquals($fab->Aggregate('AggregateTest_Fab')->Max('Foo'), 9);
  161
+		$this->assertEquals($fab->Aggregate('AggregateTest_Fac')->Max('Foo'), 6);
  162
+
157 163
 		$foo->Foo = 12;
158 164
 		$foo->write();
159 165
 
160 166
 		// For base classes, aggregate is calculcated on it and all children classes
161  
-		$this->assertEquals(DataObject::Aggregate('AggregateTest_Foo')->Max('Foo'), 12);
  167
+		$this->assertEquals($fab->Aggregate('AggregateTest_Foo')->Max('Foo'), 12);
162 168
 
163 169
 		// For subclasses, aggregate is calculated for that subclass and it's children only
164  
-		$this->assertEquals(DataObject::Aggregate('AggregateTest_Fab')->Max('Foo'), 9);
165  
-		$this->assertEquals(DataObject::Aggregate('AggregateTest_Fac')->Max('Foo'), 6);
  170
+		$this->assertEquals($fab->Aggregate('AggregateTest_Fab')->Max('Foo'), 9);
  171
+		$this->assertEquals($fab->Aggregate('AggregateTest_Fac')->Max('Foo'), 6);
166 172
 				
167  
-		$fab = $this->objFromFixture('AggregateTest_Fab', 'fab1');
168 173
 		$fab->Foo = 15;
169 174
 		$fab->write();
170 175
 		
171 176
 		// For base classes, aggregate is calculcated on it and all children classes
172  
-		$this->assertEquals(DataObject::Aggregate('AggregateTest_Foo')->Max('Foo'), 15);
  177
+		$this->assertEquals($fab->Aggregate('AggregateTest_Foo')->Max('Foo'), 15);
173 178
 
174 179
 		// For subclasses, aggregate is calculated for that subclass and it's children only
175  
-		$this->assertEquals(DataObject::Aggregate('AggregateTest_Fab')->Max('Foo'), 15);
176  
-		$this->assertEquals(DataObject::Aggregate('AggregateTest_Fac')->Max('Foo'), 6);
  180
+		$this->assertEquals($fab->Aggregate('AggregateTest_Fab')->Max('Foo'), 15);
  181
+		$this->assertEquals($fab->Aggregate('AggregateTest_Fac')->Max('Foo'), 6);
177 182
 	}
178 183
 	/* */
179 184
 	
6  tests/model/DataDifferencerTest.php
@@ -62,8 +62,8 @@ class DataDifferencerTest_Object extends DataObject implements TestOnly {
62 62
 		'HasOneRelation' => 'DataDifferencerTest_HasOneRelationObject'
63 63
 	);
64 64
 	
65  
-	function getCMSFields() {
66  
-		$fields = parent::getCMSFields();
  65
+	function getCMSFields($params = null) {
  66
+		$fields = parent::getCMSFields($params);
67 67
 		$choices = array(
68 68
 			'a' => 'a',
69 69
 			'b' => 'b',
@@ -103,4 +103,4 @@ function generateFormattedImage($format, $arg1 = null, $arg2 = null) {
103 103
 		// Skip aktual generation
104 104
 		return $gd;
105 105
 	}
106  
-}
  106
+}
2  tests/security/GroupTest.php
@@ -132,7 +132,7 @@ function testCollateAncestorIDs() {
132 132
 
133 133
 class GroupTest_Member extends Member implements TestOnly {
134 134
    
135  
-   function getCMSFields() {
  135
+   function getCMSFields($params = null) {
136 136
       $groups = DataObject::get('Group');
137 137
       $groupsMap = ($groups) ? $groups->map() : false;
138 138
       $fields = new FieldList(
10  tests/security/MemberTest.php
@@ -591,29 +591,29 @@ protected function removeExtensions($extensions) {
591 591
 }
592 592
 class MemberTest_ViewingAllowedExtension extends DataExtension implements TestOnly {
593 593
 
594  
-	public function canView() {
  594
+	public function canView($member = null) {
595 595
 		return true;
596 596
 	}
597 597
 
598 598
 }
599 599
 class MemberTest_ViewingDeniedExtension extends DataExtension implements TestOnly {
600 600
 
601  
-	public function canView() {
  601
+	public function canView($member = null) {
602 602
 		return false;
603 603
 	}
604 604
 
605 605
 }
606 606
 class MemberTest_EditingAllowedDeletingDeniedExtension extends DataExtension implements TestOnly {
607 607
 
608  
-	public function canView() {
  608
+	public function canView($member = null) {
609 609
 		return true;
610 610
 	}
611 611
 
612  
-	public function canEdit() {
  612
+	public function canEdit($member = null) {
613 613
 		return true;
614 614
 	}
615 615
 
616  
-	public function canDelete() {
  616
+	public function canDelete($member = null) {
617 617
 		return false;
618 618
 	}
619 619
 
6  tests/view/SSViewerTest.php
@@ -930,7 +930,7 @@ function obj($fieldName, $arguments=null, $forceReturnedObject=true, $cache=fals
930 930
 	}
931 931
 	
932 932
 
933  
-	function XML_val($fieldName, $arguments = null) {
  933
+	function XML_val($fieldName, $arguments = null, $cache = false) {
934 934
 		if(preg_match('/NotSet/i', $fieldName)) {
935 935
 			return '';
936 936
 		} else if(preg_match('/Raw/i', $fieldName)) {
@@ -940,7 +940,7 @@ function XML_val($fieldName, $arguments = null) {
940 940
 		}
941 941
 	}
942 942
 
943  
-	function hasValue($fieldName, $arguments = null) {
  943
+	function hasValue($fieldName, $arguments = null, $cache = true) {
944 944
 		return (bool)$this->XML_val($fieldName, $arguments);
945 945
 	}
946 946
 }
@@ -1021,4 +1021,4 @@ static function get_argmix() {
1021 1021
 		return 'z' . implode(':', $args) . 'z';
1022 1022
 	}
1023 1023
 
1024  
-}
  1024
+}

0 notes on commit e097f6e

Please sign in to comment.
Something went wrong with that request. Please try again.