ソースを参照

more E_STRICT

euromark 13 年 前
コミット
8ba87c992b
32 ファイル変更114 行追加114 行削除
  1. 1 1
      Model/Behavior/ChangePasswordBehavior.php
  2. 1 1
      Model/Behavior/DecimalInputBehavior.php
  3. 1 1
      Model/Behavior/JsonableBehavior.php
  4. 1 1
      Model/Behavior/MasterPasswordBehavior.php
  5. 1 1
      Model/Behavior/PasswordableBehavior.php
  6. 1 1
      Model/Behavior/RevisionBehavior.php
  7. 1 1
      Model/MyModel.php
  8. 1 1
      Model/Token.php
  9. 2 2
      Test/Case/Lib/AuthTest.php
  10. 1 1
      Test/Case/Lib/EmailLibTest.php
  11. 1 1
      Test/Case/Lib/MyHelperTest.php
  12. 1 1
      Test/Case/Lib/Utility/ChmodLibTest.php
  13. 1 1
      Test/Case/Lib/Utility/NumberLibTest.php
  14. 1 1
      Test/Case/Lib/Utility/TextLibTest.php
  15. 2 2
      Test/Case/Model/Behavior/BitmaskedBehaviorTest.php
  16. 2 2
      Test/Case/Model/Behavior/CaptchaBehaviorTest.php
  17. 1 1
      Test/Case/Model/Behavior/ConfirmableBehaviorTest.php
  18. 4 4
      Test/Case/Model/Behavior/DecimalInputBehaviorTest.php
  19. 17 17
      Test/Case/Model/Behavior/GeocoderBehaviorTest.php
  20. 16 16
      Test/Case/Model/Behavior/JsonableBehaviorTest.php
  21. 7 7
      Test/Case/Model/Behavior/KeyValueBehaviorTest.php
  22. 2 2
      Test/Case/Model/Behavior/LinkableBehaviorTest.php
  23. 5 5
      Test/Case/Model/Behavior/MasterPasswordBehaviorTest.php
  24. 11 11
      Test/Case/Model/Behavior/PasswordableBehaviorTest.php
  25. 2 2
      Test/Case/Model/Behavior/RevisionBehaviorTest.php
  26. 18 18
      Test/Case/Model/Behavior/SluggedBehaviorTest.php
  27. 7 7
      Test/Case/Model/Behavior/TypographicBehaviorTest.php
  28. 1 1
      Test/Case/Model/CodeKeyTest.php
  29. 1 1
      Test/Case/Model/ContactFormTest.php
  30. 1 1
      Test/Case/Model/QloginTest.php
  31. 1 1
      Test/Case/Model/TokenTest.php
  32. 1 1
      Test/Case/View/Helper/FlattrHelperTest.php

+ 1 - 1
Model/Behavior/ChangePasswordBehavior.php

@@ -19,7 +19,7 @@ if (!defined('PWD_MAX_LENGTH')) {
  *
  * usage: do NOT add it via $actAs = array()
  * attach it dynamically in only those actions where you actually change the password like so:
- * $this->User->Behaviors->attach('Tools.ChangePassword', array(SETTINGSARRAY));
+ * $this->User->Behaviors->load('Tools.ChangePassword', array(SETTINGSARRAY));
  * as first line in any action where you want to allow the user to change his password
  * also add the two form fields in the form (pwd, pwd_confirm)
  * the rest is cake automagic :)

+ 1 - 1
Model/Behavior/DecimalInputBehavior.php

@@ -97,7 +97,7 @@ class DecimalInputBehavior extends ModelBehavior {
 		return true;
 	}
 
-	public function afterFind(Model $Model, $results) {
+	public function afterFind(Model $Model, $results, $primary) {
 		if (!$this->config[$Model->alias]['output'] || empty($results)) {
 			return $results;
 		}

+ 1 - 1
Model/Behavior/JsonableBehavior.php

@@ -70,7 +70,7 @@ class JsonableBehavior extends ModelBehavior {
 	 * @return array
 	 * @access public
 	 */
-	public function afterFind(Model $Model, $results) {
+	public function afterFind(Model $Model, $results, $primary) {
 		$results = $this->decodeItems($Model, $results);
 		return $results;
 	}

+ 1 - 1
Model/Behavior/MasterPasswordBehavior.php

@@ -10,7 +10,7 @@ App::uses('ModelBehavior', 'Model');
  *
  * Usage:
  * In the controller:
- * $this->ModelName->Behaviors->attach('Tools.MasterPassword');
+ * $this->ModelName->Behaviors->load('Tools.MasterPassword');
  * In the view:
  * echo $this->element('master_password', array(), array('plugin'=>'tools'));
  * Put this into your private configs:

+ 1 - 1
Model/Behavior/PasswordableBehavior.php

@@ -19,7 +19,7 @@ if (!defined('PWD_MAX_LENGTH')) {
  *
  * usage: do NOT add it via $actAs = array()
  * attach it dynamically in only those actions where you actually change the password like so:
- * $this->User->Behaviors->attach('Tools.Passwordable', array(SETTINGSARRAY));
+ * $this->User->Behaviors->load('Tools.Passwordable', array(SETTINGSARRAY));
  * as first line in any action where you want to allow the user to change his password
  * also add the two form fields in the form (pwd, pwd_confirm)
  * the rest is cake automagic :)

+ 1 - 1
Model/Behavior/RevisionBehavior.php

@@ -154,7 +154,7 @@ class RevisionBehavior extends ModelBehavior {
 			$this->settings[$Model->alias] = $this->defaults;
 		}
 		$this->createShadowModel($Model);
-		$Model->Behaviors->attach('Containable');
+		$Model->Behaviors->load('Containable');
 	}
 
 	/**

+ 1 - 1
Model/MyModel.php

@@ -1582,7 +1582,7 @@ class MyModel extends Model {
 	 */
 	public function recursiveSelect($conditions = array(), $attachTree = false, $spacer = '-- ') {
 		if ($attachTree) {
-			$this->Behaviors->attach('Tree');
+			$this->Behaviors->load('Tree');
 		}
 		$data = $this->generateTreeList($conditions, null, null, $spacer);
 		return $data;

+ 1 - 1
Model/Token.php

@@ -83,7 +83,7 @@ class Token extends ToolsAppModel {
 			$data['key'] = $this->generateKey($keyLength);
 			$this->set($data);
 			$max--;
-			if ($max == 0) { //die('Exeption in Token');
+			if ($max === 0) { //die('Exeption in Token');
 			 	return false;
 			}
 		}

+ 2 - 2
Test/Case/Lib/AuthTest.php

@@ -9,11 +9,11 @@ class AuthTest extends MyCakeTestCase {
 
 	public $fixtures = array('core.session');
 
-	public function startTest() {
+	public function setUp() {
 		ClassRegistry::init('Session');
 	}
 
-	public function endTest() {
+	public function tearDown() {
 		ClassRegistry::flush();
 	}
 

+ 1 - 1
Test/Case/Lib/EmailLibTest.php

@@ -9,7 +9,7 @@ class EmailLibTest extends MyCakeTestCase {
 
 	public $Email;
 
-	public function startTest() {
+	public function setUp() {
 		$this->Email = new EmailLib();
 	}
 

+ 1 - 1
Test/Case/Lib/MyHelperTest.php

@@ -8,7 +8,7 @@ class MyHelperTest extends MyCakeTestCase {
 
 	public $MyHelper;
 
-	public function startTest() {
+	public function setUp() {
 		$this->MyHelper = new MyHelper(new View(null));
 	}
 

+ 1 - 1
Test/Case/Lib/Utility/ChmodLibTest.php

@@ -9,7 +9,7 @@ App::uses('ChmodLib', 'Tools.Utility');
 class ChmodLibTest extends CakeTestCase {
 	public $Chmod = null;
 
-	public function startTest() {
+	public function setUp() {
 		$this->Chmod = new ChmodLib();
 
 	}

+ 1 - 1
Test/Case/Lib/Utility/NumberLibTest.php

@@ -7,7 +7,7 @@ class NumberLibTest extends MyCakeTestCase {
 
 	public $NumberLib = null;
 
-	public function startTest() {
+	public function setUp() {
 		//$this->NumberLib = new NumberLib();
 	}
 

+ 1 - 1
Test/Case/Lib/Utility/TextLibTest.php

@@ -7,7 +7,7 @@ App::uses('TextLib', 'Tools.Utility');
  */
 class TextLibTest extends CakeTestCase {
 
-	public function startTest() {
+	public function setUp() {
 		$this->TextLib = new TextLib(null);
 	}
 

+ 2 - 2
Test/Case/Model/Behavior/BitmaskedBehaviorTest.php

@@ -13,10 +13,10 @@ class BitmaskedBehaviorTest extends MyCakeTestCase {
 
 	public $Comment;
 
-	public function startTest() {
+	public function setUp() {
 
 		$this->Comment = new BitmaskedComment();
-		$this->Comment->Behaviors->attach('Bitmasked', array('mappedField'=>'statuses'));
+		$this->Comment->Behaviors->load('Bitmasked', array('mappedField'=>'statuses'));
 	}
 
 	public function testEncodeBitmask() {

+ 2 - 2
Test/Case/Model/Behavior/CaptchaBehaviorTest.php

@@ -11,13 +11,13 @@ class CaptchaBehaviorTest extends MyCakeTestCase {
 
 	public $Comment;
 
-	public function startTest() {
+	public function setUp() {
 
 	}
 
 	public function setUp() {
 		$this->Comment = ClassRegistry::init('Comment');
-		$this->Comment->Behaviors->attach('Tools.Captcha', array());
+		$this->Comment->Behaviors->load('Tools.Captcha', array());
 	}
 
 	public function tearDown() {

+ 1 - 1
Test/Case/Model/Behavior/ConfirmableBehaviorTest.php

@@ -8,7 +8,7 @@ class ConfirmableBehaviorTest extends MyCakeTestCase {
 
 	public $ConfirmableBehavior;
 
-	public function startTest() {
+	public function setUp() {
 		$this->ConfirmableBehavior = new ConfirmableBehavior();
 	}
 

+ 4 - 4
Test/Case/Model/Behavior/DecimalInputBehaviorTest.php

@@ -5,10 +5,10 @@ App::uses('MyCakeTestCase', 'Tools.TestSuite');
 
 class DecimalInputBehaviorTest extends MyCakeTestCase {
 
-	public function startTest() {
+	public function setUp() {
 		//$this->Comment = ClassRegistry::init('Comment');
 		$this->Comment = new DecimalInputTestModel();
-		$this->Comment->Behaviors->attach('Tools.DecimalInput', array('fields'=>array('rel_rate', 'set_rate'), 'output'=>true));
+		$this->Comment->Behaviors->load('Tools.DecimalInput', array('fields'=>array('rel_rate', 'set_rate'), 'output'=>true));
 	}
 
 	public function setUp() {
@@ -82,8 +82,8 @@ class DecimalInputBehaviorTest extends MyCakeTestCase {
 	}
 
 	public function testStrict() {
-		$this->Comment->Behaviors->detach('DecimalInput');
-		$this->Comment->Behaviors->attach('Tools.DecimalInput', array('fields'=>array('rel_rate', 'set_rate'), 'strict'=>true));
+		$this->Comment->Behaviors->unload('DecimalInput');
+		$this->Comment->Behaviors->load('Tools.DecimalInput', array('fields'=>array('rel_rate', 'set_rate'), 'strict'=>true));
 
 		$data = array(
 			'name' => 'some Name',

+ 17 - 17
Test/Case/Model/Behavior/GeocoderBehaviorTest.php

@@ -10,10 +10,10 @@ class GeocoderBehaviorTest extends CakeTestCase {
 		'core.comment', 'plugin.tools.address'
 	);
 
-	public function startTest() {
+	public function setUp() {
 		$this->Comment = ClassRegistry::init('Comment');
 
-		$this->Comment->Behaviors->attach('Tools.Geocoder', array('real'=>false));
+		$this->Comment->Behaviors->load('Tools.Geocoder', array('real'=>false));
 	}
 
 	public function testDistance() {
@@ -21,8 +21,8 @@ class GeocoderBehaviorTest extends CakeTestCase {
 		$expected = '6371.04 * ACOS( COS( PI()/2 - RADIANS(90 - Comment.lat)) * COS( PI()/2 - RADIANS(90 - 12)) * COS( RADIANS(Comment.lng) - RADIANS(14)) + SIN( PI()/2 - RADIANS(90 - Comment.lat)) * SIN( PI()/2 - RADIANS(90 - 12)))';
 		$this->assertEquals($expected, $res);
 
-		$this->Comment->Behaviors->detach('Geocoder');
-		$this->Comment->Behaviors->attach('Tools.Geocoder', array('lat'=>'x', 'lng'=>'y'));
+		$this->Comment->Behaviors->unload('Geocoder');
+		$this->Comment->Behaviors->load('Tools.Geocoder', array('lat'=>'x', 'lng'=>'y'));
 		$res = $this->Comment->distance(12, 14);
 		$expected = '6371.04 * ACOS( COS( PI()/2 - RADIANS(90 - Comment.x)) * COS( PI()/2 - RADIANS(90 - 12)) * COS( RADIANS(Comment.y) - RADIANS(14)) + SIN( PI()/2 - RADIANS(90 - Comment.x)) * SIN( PI()/2 - RADIANS(90 - 12)))';
 		$this->assertEquals($expected, $res);
@@ -36,7 +36,7 @@ class GeocoderBehaviorTest extends CakeTestCase {
 
 	public function testSetDistanceAsVirtualField() {
 		$this->Address = ClassRegistry::init('Address');
-		$this->Address->Behaviors->attach('Tools.Geocoder');
+		$this->Address->Behaviors->load('Tools.Geocoder');
 		$this->Address->setDistanceAsVirtualField(13.3, 19.2);
 		$options = array('order' => array('Address.distance' => 'ASC'));
 		$res = $this->Address->find('all', $options);
@@ -47,7 +47,7 @@ class GeocoderBehaviorTest extends CakeTestCase {
 
 	public function testSetDistanceAsVirtualFieldInMiles() {
 		$this->Address = ClassRegistry::init('Address');
-		$this->Address->Behaviors->attach('Tools.Geocoder', array('unit' => GeocodeLib::UNIT_MILES));
+		$this->Address->Behaviors->load('Tools.Geocoder', array('unit' => GeocodeLib::UNIT_MILES));
 		$this->Address->setDistanceAsVirtualField(13.3, 19.2);
 		$options = array('order' => array('Address.distance' => 'ASC'));
 		$res = $this->Address->find('all', $options);
@@ -59,7 +59,7 @@ class GeocoderBehaviorTest extends CakeTestCase {
 	public function testPagination() {
 		$this->Controller = new TestController(new CakeRequest(null, false), null);
 		$this->Controller->constructClasses();
-		$this->Controller->Address->Behaviors->attach('Tools.Geocoder');
+		$this->Controller->Address->Behaviors->load('Tools.Geocoder');
 		$this->Controller->Address->setDistanceAsVirtualField(13.3, 19.2);
 		$this->Controller->paginate = array(
 			'conditions'=>array('distance <' => 3000),
@@ -139,8 +139,8 @@ class GeocoderBehaviorTest extends CakeTestCase {
 	public function testMinAccLow() {
 		echo '<h3>'.__FUNCTION__.'</h3>';
 
-		$this->Comment->Behaviors->detach('Geocoder');
-		$this->Comment->Behaviors->attach('Tools.Geocoder', array('real'=>false, 'min_accuracy'=>0));
+		$this->Comment->Behaviors->unload('Geocoder');
+		$this->Comment->Behaviors->load('Tools.Geocoder', array('real'=>false, 'min_accuracy'=>0));
 		// accuracy = 1
 		$data = array(
 	 		//'street' => 'Leopoldstraße',
@@ -159,8 +159,8 @@ class GeocoderBehaviorTest extends CakeTestCase {
 	public function testMinAccHigh() {
 		echo '<h3>'.__FUNCTION__.'</h3>';
 
-		$this->Comment->Behaviors->detach('Geocoder');
-		$this->Comment->Behaviors->attach('Tools.Geocoder', array('real'=>false, 'min_accuracy'=>4));
+		$this->Comment->Behaviors->unload('Geocoder');
+		$this->Comment->Behaviors->load('Tools.Geocoder', array('real'=>false, 'min_accuracy'=>4));
 		// accuracy = 1
 		$data = array(
 	 		//'street' => 'Leopoldstraße',
@@ -180,8 +180,8 @@ class GeocoderBehaviorTest extends CakeTestCase {
 	public function testMinInc() {
 		echo '<h3>'.__FUNCTION__.'</h3>';
 
-		$this->Comment->Behaviors->detach('Geocoder');
-		$this->Comment->Behaviors->attach('Tools.Geocoder', array('real'=>false, 'min_accuracy'=>GeocodeLib::ACC_SUBLOC));
+		$this->Comment->Behaviors->unload('Geocoder');
+		$this->Comment->Behaviors->load('Tools.Geocoder', array('real'=>false, 'min_accuracy'=>GeocodeLib::ACC_SUBLOC));
 
 		$this->assertEquals(GeocodeLib::ACC_SUBLOC, $this->Comment->Behaviors->Geocoder->settings['Comment']['min_accuracy']);
 
@@ -205,8 +205,8 @@ class GeocoderBehaviorTest extends CakeTestCase {
 	public function testMinIncAllowed() {
 		echo '<h3>'.__FUNCTION__.'</h3>';
 
-		$this->Comment->Behaviors->detach('Geocoder');
-		$this->Comment->Behaviors->attach('Tools.Geocoder', array('real'=>false, 'allow_inconclusive'=>true));
+		$this->Comment->Behaviors->unload('Geocoder');
+		$this->Comment->Behaviors->load('Tools.Geocoder', array('real'=>false, 'allow_inconclusive'=>true));
 		// accuracy = 1
 		$data = array(
 	 		//'street' => 'Leopoldstraße',
@@ -227,8 +227,8 @@ class GeocoderBehaviorTest extends CakeTestCase {
 	}
 
 	public function testExpect() {
-		$this->Comment->Behaviors->detach('Geocoder');
-		$this->Comment->Behaviors->attach('Tools.Geocoder', array('real'=>false, 'expect'=>array('postal_code')));
+		$this->Comment->Behaviors->unload('Geocoder');
+		$this->Comment->Behaviors->load('Tools.Geocoder', array('real'=>false, 'expect'=>array('postal_code')));
 		// accuracy = 1
 		$data = array(
 	 		//'street' => 'Leopoldstraße',

+ 16 - 16
Test/Case/Model/Behavior/JsonableBehaviorTest.php

@@ -13,10 +13,10 @@ class JsonableBehaviorTest extends MyCakeTestCase {
 
 	public $Comment;
 
-	public function startTest() {
+	public function setUp() {
 		//$this->Comment = ClassRegistry::init('Comment');
 		$this->Comment = new JsonableBehaviorTestModel();
-		$this->Comment->Behaviors->attach('Tools.Jsonable', array());
+		$this->Comment->Behaviors->load('Tools.Jsonable', array());
 	}
 
 /** INPUT **/
@@ -40,8 +40,8 @@ class JsonableBehaviorTest extends MyCakeTestCase {
 
 	public function testFieldsWithList() {
 		echo $this->_header(__FUNCTION__);
-		$this->Comment->Behaviors->detach('Jsonable');
-		$this->Comment->Behaviors->attach('Tools.Jsonable', array('fields'=>array('details'), 'input'=>'list'));
+		$this->Comment->Behaviors->unload('Jsonable');
+		$this->Comment->Behaviors->load('Tools.Jsonable', array('fields'=>array('details'), 'input'=>'list'));
 
 		$data = array(
 			'comment' => 'blabla',
@@ -63,8 +63,8 @@ class JsonableBehaviorTest extends MyCakeTestCase {
 			'name' => 'some Name',
 			'details' => 'z|x|y|x',
 		);
-		$this->Comment->Behaviors->detach('Jsonable');
-		$this->Comment->Behaviors->attach('Tools.Jsonable', array('fields'=>array('details'), 'input'=>'list', 'sort'=>true));
+		$this->Comment->Behaviors->unload('Jsonable');
+		$this->Comment->Behaviors->load('Tools.Jsonable', array('fields'=>array('details'), 'input'=>'list', 'sort'=>true));
 
 		$res = $this->Comment->save($data);
 		$this->assertTrue($res);
@@ -76,8 +76,8 @@ class JsonableBehaviorTest extends MyCakeTestCase {
 
 	public function testFieldsWithParam() {
 		echo $this->_header(__FUNCTION__);
-		$this->Comment->Behaviors->detach('Jsonable');
-		$this->Comment->Behaviors->attach('Tools.Jsonable', array('fields'=>array('details'), 'input'=>'param'));
+		$this->Comment->Behaviors->unload('Jsonable');
+		$this->Comment->Behaviors->load('Tools.Jsonable', array('fields'=>array('details'), 'input'=>'param'));
 
 		$data = array(
 			'comment' => 'blabla',
@@ -99,8 +99,8 @@ class JsonableBehaviorTest extends MyCakeTestCase {
 
 	public function testFieldsOnFind() {
 		echo $this->_header(__FUNCTION__);
-		$this->Comment->Behaviors->detach('Jsonable');
-		$this->Comment->Behaviors->attach('Tools.Jsonable', array('fields'=>array('details')));
+		$this->Comment->Behaviors->unload('Jsonable');
+		$this->Comment->Behaviors->load('Tools.Jsonable', array('fields'=>array('details')));
 
 		$res = $this->Comment->find('first', array());
 
@@ -108,8 +108,8 @@ class JsonableBehaviorTest extends MyCakeTestCase {
 		pr($res);
 
 
-		$this->Comment->Behaviors->detach('Jsonable');
-		$this->Comment->Behaviors->attach('Tools.Jsonable', array('output'=>'param', 'fields'=>array('details')));
+		$this->Comment->Behaviors->unload('Jsonable');
+		$this->Comment->Behaviors->load('Tools.Jsonable', array('output'=>'param', 'fields'=>array('details')));
 
 		$res = $this->Comment->find('first', array());
 		pr($res);
@@ -118,8 +118,8 @@ class JsonableBehaviorTest extends MyCakeTestCase {
 
 
 
-		$this->Comment->Behaviors->detach('Jsonable');
-		$this->Comment->Behaviors->attach('Tools.Jsonable', array('output'=>'list', 'fields'=>array('details')));
+		$this->Comment->Behaviors->unload('Jsonable');
+		$this->Comment->Behaviors->load('Tools.Jsonable', array('output'=>'list', 'fields'=>array('details')));
 
 		$data = array(
 			'comment' => 'blabla',
@@ -134,8 +134,8 @@ class JsonableBehaviorTest extends MyCakeTestCase {
 		echo BR.BR;
 
 
-		$this->Comment->Behaviors->detach('Jsonable');
-		$this->Comment->Behaviors->attach('Tools.Jsonable', array('output'=>'list', 'separator'=>', ', 'fields'=>array('details')));
+		$this->Comment->Behaviors->unload('Jsonable');
+		$this->Comment->Behaviors->load('Tools.Jsonable', array('output'=>'list', 'separator'=>', ', 'fields'=>array('details')));
 
 		$data = array(
 			'comment' => 'blabla',

+ 7 - 7
Test/Case/Model/Behavior/KeyValueBehaviorTest.php

@@ -16,7 +16,7 @@ class KeyValueBehaviorTest extends MyCakeTestCase {
 
 		$this->KeyValueBehavior = new KeyValueBehavior();
 		$this->Model = ClassRegistry::init('User');
-		$this->Model->Behaviors->attach('Tools.KeyValue');
+		$this->Model->Behaviors->load('Tools.KeyValue');
 	}
 
 	public function testObject() {
@@ -64,8 +64,8 @@ class KeyValueBehaviorTest extends MyCakeTestCase {
 				'z' => '123',
 			)
 		);
-		$this->Model->Behaviors->detach('KeyValue');
-		$this->Model->Behaviors->attach('Tools.KeyValue');
+		$this->Model->Behaviors->unload('KeyValue');
+		$this->Model->Behaviors->load('Tools.KeyValue');
 
 		$this->Model->saveSection(0, array('User'=>array('x'=>1, 'y'=>'z')));
 
@@ -92,8 +92,8 @@ class KeyValueBehaviorTest extends MyCakeTestCase {
 		$res = $this->Model->Behaviors->KeyValue->KeyValue->find('count');
 		$this->assertEquals(2, $res);
 
-		$this->Model->Behaviors->detach('KeyValue');
-		$this->Model->Behaviors->attach('Tools.KeyValue', array('defaultOnEmpty' => true));
+		$this->Model->Behaviors->unload('KeyValue');
+		$this->Model->Behaviors->load('Tools.KeyValue', array('defaultOnEmpty' => true));
 		$this->Model->keyValueDefaults = array(
 			'User' => array(
 				'x' => 0,
@@ -110,8 +110,8 @@ class KeyValueBehaviorTest extends MyCakeTestCase {
 		$res = $this->Model->Behaviors->KeyValue->KeyValue->find('count');
 		$this->assertEquals(3, $res);
 
-		$this->Model->Behaviors->detach('KeyValue');
-		$this->Model->Behaviors->attach('Tools.KeyValue', array('deleteIfDefault' => true));
+		$this->Model->Behaviors->unload('KeyValue');
+		$this->Model->Behaviors->load('Tools.KeyValue', array('deleteIfDefault' => true));
 		$res = $this->Model->saveSection(0, array('User'=>array('z'=>'123')));
 		$this->assertTrue($res);
 		$res = $this->Model->Behaviors->KeyValue->KeyValue->find('count');

+ 2 - 2
Test/Case/Model/Behavior/LinkableBehaviorTest.php

@@ -21,11 +21,11 @@ class LinkableBehaviorTest extends CakeTestCase {
 
 	public $User;
 
-	public function startTest() {
+	public function setUp() {
 		$this->User = ClassRegistry::init('User');
 	}
 
-	public function endTest() {
+	public function tearDown() {
 		unset($this->User);
 	}
 

+ 5 - 5
Test/Case/Model/Behavior/MasterPasswordBehaviorTest.php

@@ -24,7 +24,7 @@ class MasterPasswordBehaviorTest extends MyCakeTestCase {
 	 * test 123456
 	 */
 	public function testSinglePwd() {
-		$this->Model->Behaviors->attach('Tools.MasterPassword');
+		$this->Model->Behaviors->load('Tools.MasterPassword');
 
 		$data = array(
 			'some_comment' => 'xyz',
@@ -64,7 +64,7 @@ class MasterPasswordBehaviorTest extends MyCakeTestCase {
 	 */
 	public function testComplex() {
 		Configure::write('MasterPassword.password', '373e28e7cdb42d7aefc49c5f34fa589a7ff1eefd0ac01f573d90299f79a01a05');
-		$this->Model->Behaviors->attach('Tools.MasterPassword', array('field'=>'master_password', 'hash'=>'sha256', 'message'=>'No way'));
+		$this->Model->Behaviors->load('Tools.MasterPassword', array('field'=>'master_password', 'hash'=>'sha256', 'message'=>'No way'));
 
 		$data = array(
 			'some_comment' => 'xyz',
@@ -92,7 +92,7 @@ class MasterPasswordBehaviorTest extends MyCakeTestCase {
 	public function testWithSalt() {
 		$hash = hash('sha256', Configure::read('Security.salt').'xxyyzz');
 		Configure::write('MasterPassword.password', $hash);
-		$this->Model->Behaviors->attach('Tools.MasterPassword', array('hash'=>'sha256', 'salt'=>true));
+		$this->Model->Behaviors->load('Tools.MasterPassword', array('hash'=>'sha256', 'salt'=>true));
 		$data = array(
 			'some_comment' => 'xyz',
 			'master_pwd' => 'xxyyzz'
@@ -103,7 +103,7 @@ class MasterPasswordBehaviorTest extends MyCakeTestCase {
 
 		$hash = hash('sha256', '123'.'xxyyzz');
 		Configure::write('MasterPassword.password', $hash);
-		$this->Model->Behaviors->attach('Tools.MasterPassword', array('hash'=>'sha256', 'salt'=>'123'));
+		$this->Model->Behaviors->load('Tools.MasterPassword', array('hash'=>'sha256', 'salt'=>'123'));
 		$data = array(
 			'some_comment' => 'xyz',
 			'master_pwd' => 'xxyyzz'
@@ -118,7 +118,7 @@ class MasterPasswordBehaviorTest extends MyCakeTestCase {
 	 */
 	public function testMultiplePwd() {
 		Configure::write('MasterPassword.password', array('dd5fef9c1c1da1394d6d34b248c51be2ad740840', '7c4a8d09ca3762af61e59520943dc26494f8941b'));
-		$this->Model->Behaviors->attach('Tools.MasterPassword');
+		$this->Model->Behaviors->load('Tools.MasterPassword');
 
 		$data = array(
 			'some_comment' => 'xyz',

+ 11 - 11
Test/Case/Model/Behavior/PasswordableBehaviorTest.php

@@ -40,7 +40,7 @@ class PasswordableBehaviorTest extends CakeTestCase {
 
 
 	public function testObject() {
-		$this->User->Behaviors->attach('Tools.Passwordable', array());
+		$this->User->Behaviors->load('Tools.Passwordable', array());
 		$this->assertInstanceOf('PasswordableBehavior', $this->User->Behaviors->Passwordable);
 		$res = $this->User->Behaviors->attached('Passwordable');
 		$this->assertTrue($res);
@@ -50,7 +50,7 @@ class PasswordableBehaviorTest extends CakeTestCase {
 	 * make sure validation is triggered correctly
 	 */
 	public function testValidate() {
-		$this->User->Behaviors->attach('Tools.Passwordable', array());
+		$this->User->Behaviors->load('Tools.Passwordable', array());
 
 		$this->User->create();
 		$data = array(
@@ -90,7 +90,7 @@ class PasswordableBehaviorTest extends CakeTestCase {
 	 * test that confirm false does not require confirmation
 	 */
 	public function testValidateNoConfirm() {
-		$this->User->Behaviors->attach('Tools.Passwordable', array('confirm'=>false));
+		$this->User->Behaviors->load('Tools.Passwordable', array('confirm'=>false));
 		$this->User->create();
 		$data = array(
 			'pwd' => '123456',
@@ -105,7 +105,7 @@ class PasswordableBehaviorTest extends CakeTestCase {
 	 * validation and update process gets skipped if no values are entered
 	 */
 	public function testValidateEmpty() {
-		$this->User->Behaviors->attach('Tools.Passwordable');
+		$this->User->Behaviors->load('Tools.Passwordable');
 		$this->User->create();
 		$data = array(
 			'pwd' => '',
@@ -118,10 +118,10 @@ class PasswordableBehaviorTest extends CakeTestCase {
 		$this->assertEquals(array('pwd', 'pwd_repeat'), array_keys($this->User->validationErrors));
 
 
-		$this->User->Behaviors->detach('Passwordable');
+		$this->User->Behaviors->unload('Passwordable');
 		$this->User->validate = array();
 
-		$this->User->Behaviors->attach('Tools.Passwordable', array('current'=>true));
+		$this->User->Behaviors->load('Tools.Passwordable', array('current'=>true));
 		$this->User->create();
 		$data = array(
 			'id' => 123,
@@ -138,7 +138,7 @@ class PasswordableBehaviorTest extends CakeTestCase {
 		$this->tearDown();
 		$this->setUp();
 
-		$this->User->Behaviors->attach('Tools.Passwordable', array('allowEmpty'=>true, 'current'=>true));
+		$this->User->Behaviors->load('Tools.Passwordable', array('allowEmpty'=>true, 'current'=>true));
 		$this->User->create();
 		$data = array(
 			'user' => 'foo',
@@ -154,7 +154,7 @@ class PasswordableBehaviorTest extends CakeTestCase {
 	 * test aliases for field names
 	 */
 	public function testDifferentFieldNames() {
-		$this->User->Behaviors->attach('Tools.Passwordable', array(
+		$this->User->Behaviors->load('Tools.Passwordable', array(
 			'formField' => 'passw',
 			'formFieldRepeat' => 'passw_repeat',
 			'formFieldCurrent' => 'passw_current',
@@ -175,7 +175,7 @@ class PasswordableBehaviorTest extends CakeTestCase {
 	 * assert that allowSame false does not allow storing the same password as previously entered
 	 */
 	public function testNotSame() {
-		$this->User->Behaviors->attach('Tools.Passwordable', array(
+		$this->User->Behaviors->load('Tools.Passwordable', array(
 			'formField' => 'passw',
 			'formFieldRepeat' => 'passw_repeat',
 			'formFieldCurrent' => 'passw_current',
@@ -211,7 +211,7 @@ class PasswordableBehaviorTest extends CakeTestCase {
 	 * assert that allowSame false does not allow storing the same password as previously entered
 	 */
 	public function testNotSameWithoutCurrentField() {
-		$this->User->Behaviors->attach('Tools.Passwordable', array(
+		$this->User->Behaviors->load('Tools.Passwordable', array(
 			'formField' => 'passw',
 			'formFieldRepeat' => 'passw_repeat',
 			'allowSame' => false,
@@ -264,7 +264,7 @@ class PasswordableBehaviorTest extends CakeTestCase {
 		//$this->tearDown();
 		//$this->setUp();
 
-		$this->User->Behaviors->attach('Tools.Passwordable', array('current'=>true));
+		$this->User->Behaviors->load('Tools.Passwordable', array('current'=>true));
 		$this->User->create();
 		$data = array(
 			'id' => $uid,

+ 2 - 2
Test/Case/Model/Behavior/RevisionBehaviorTest.php

@@ -1006,8 +1006,8 @@ class RevisionBehaviorTest extends CakeTestCase {
 
 		$Comment = new RevisionComment();
 
-		$Comment->Behaviors->detach('Revision');
-		$Comment->Behaviors->attach('Revision', array('ignore' => array('Tag')));
+		$Comment->Behaviors->unload('Revision');
+		$Comment->Behaviors->load('Revision', array('ignore' => array('Tag')));
 
 		$Comment->bindModel(array('hasAndBelongsToMany' => array('Tag' => array('className' => 'RevisionTag'))), false);
 

+ 18 - 18
Test/Case/Model/Behavior/SluggedBehaviorTest.php

@@ -116,8 +116,8 @@ class SluggedBehaviorTest extends CakeTestCase {
  * @return void
  * @access public
  */
-	public function startTest() {
-		//parent::startTest();
+	public function setUp() {
+		//parent::setUp();
 		$this->Model = new MessageSlugged();
 	}
 
@@ -128,8 +128,8 @@ class SluggedBehaviorTest extends CakeTestCase {
  * @return void
  */
 	public function testSlugGenerationBasedOnTrigger() {
-		$this->Model->Behaviors->detach('Slugged');
-		$this->Model->Behaviors->attach('Tools.Slugged', array(
+		$this->Model->Behaviors->unload('Slugged');
+		$this->Model->Behaviors->load('Tools.Slugged', array(
 			'trigger' => 'generateSlug', 'overwrite' => true));
 
 		$this->Model->generateSlug = false;
@@ -150,8 +150,8 @@ class SluggedBehaviorTest extends CakeTestCase {
  * @return void
  */
 	public function testSlugGenerationI18nReplacementPieces() {
-		$this->Model->Behaviors->detach('Slugged');
-		$this->Model->Behaviors->attach('Tools.Slugged', array(
+		$this->Model->Behaviors->unload('Slugged');
+		$this->Model->Behaviors->load('Tools.Slugged', array(
 			'overwrite' => true));
 
 		$this->Model->create(array('name' => 'Some & More'));
@@ -166,8 +166,8 @@ class SluggedBehaviorTest extends CakeTestCase {
  * @return void
  */
 	public function testSlugDynamicOverwrite() {
-		$this->Model->Behaviors->detach('Slugged');
-		$this->Model->Behaviors->attach('Tools.Slugged', array(
+		$this->Model->Behaviors->unload('Slugged');
+		$this->Model->Behaviors->load('Tools.Slugged', array(
 			'overwrite' => false, 'overwriteField' => 'overwrite_my_slug'));
 
 		$this->Model->create();
@@ -191,8 +191,8 @@ class SluggedBehaviorTest extends CakeTestCase {
  * @return void
  */
 	public function testSlugGenerationWithScope() {
-		$this->Model->Behaviors->detach('Slugged');
-		$this->Model->Behaviors->attach('Tools.Slugged', array('unique' => true));
+		$this->Model->Behaviors->unload('Slugged');
+		$this->Model->Behaviors->load('Tools.Slugged', array('unique' => true));
 
 		$data = array('name' => 'Some Article 12345', 'section' => 0);
 
@@ -206,8 +206,8 @@ class SluggedBehaviorTest extends CakeTestCase {
 		$this->assertTrue((bool)$result);
 		$this->assertEquals('Some-Article-12345-1', $result[$this->Model->alias]['slug']);
 
-		$this->Model->Behaviors->detach('Slugged');
-		$this->Model->Behaviors->attach('Tools.Slugged', array('unique' => true, 'scope' => array('section' => 1)));
+		$this->Model->Behaviors->unload('Slugged');
+		$this->Model->Behaviors->load('Tools.Slugged', array('unique' => true, 'scope' => array('section' => 1)));
 
 		$data = array('name' => 'Some Article 12345', 'section' => 1);
 
@@ -392,7 +392,7 @@ class SluggedBehaviorTest extends CakeTestCase {
 		$modes = array('id'); // overriden
 		$this->Socket = new HttpSocket('http://validator.w3.org:80');
 		foreach ($modes as $mode) {
-			$this->Model->Behaviors->attach('Slugged', array('mode' => $mode));
+			$this->Model->Behaviors->load('Slugged', array('mode' => $mode));
 			$this->_testMode($mode, 1, 1); // overriden parameters
 		}
 	}
@@ -18025,7 +18025,7 @@ class SluggedBehaviorTest extends CakeTestCase {
  * @access public
  */
 	public function testUrlMode() {
-		$this->Model->Behaviors->attach('Slugged', array('mode' => 'url', 'replace' => false));
+		$this->Model->Behaviors->load('Slugged', array('mode' => 'url', 'replace' => false));
 		$string = 'standard string';
 		$expects = 'standard-string';
 		$result = $this->Model->slug($string);
@@ -18151,7 +18151,7 @@ class SluggedBehaviorTest extends CakeTestCase {
 		$encoding = Configure::read('App.encoding');
 		Configure::write('App.encoding', 'UTF-8');
 
-		$this->Model->Behaviors->attach('Slugged', array('length' => 50));
+		$this->Model->Behaviors->load('Slugged', array('length' => 50));
 		$result = $this->Model->slug('モデルのデータベースとデータソース');
 		$expects = 'モデルのデータベースとデータソー';
 		$this->assertEquals($expects, $result);
@@ -18159,12 +18159,12 @@ class SluggedBehaviorTest extends CakeTestCase {
 		Configure::write('App.encoding', 'SJIS');
 		$sjisEncoded = mb_convert_encoding($testString, 'SJIS', 'UTF-8');
 
-		$this->Model->Behaviors->attach('Slugged', array('length' => 33));
+		$this->Model->Behaviors->load('Slugged', array('length' => 33));
 		$result = $this->Model->slug($sjisEncoded);
 		$sjisExpects = mb_convert_encoding('モデルのデータベースとデータソー', 'SJIS', 'UTF-8');
 		$this->assertEquals($result, $sjisExpects);
 
-		$this->Model->Behaviors->attach('Slugged', array('length' => 50, 'encoding' => 'UTF-8'));
+		$this->Model->Behaviors->load('Slugged', array('length' => 50, 'encoding' => 'UTF-8'));
 		$result = $this->Model->slug($sjisEncoded);
 		$expects = 'モデルのデータベースとデータソー';
 		$this->assertEquals($expects, $result);
@@ -18181,7 +18181,7 @@ class SluggedBehaviorTest extends CakeTestCase {
  * @access public
  */
 	public function testDuplicateWithLengthRestriction() {
-		$this->Model->Behaviors->attach('Slugged', array('label' => 'name', 'length' => 10, 'unique' => true));
+		$this->Model->Behaviors->load('Slugged', array('label' => 'name', 'length' => 10, 'unique' => true));
 
 		$this->Model->create();
 		$this->Model->save(array('name' => 'Andy Dawson'));

+ 7 - 7
Test/Case/Model/Behavior/TypographicBehaviorTest.php

@@ -15,7 +15,7 @@ class TypographicBehaviorTest extends MyCakeTestCase {
 		parent::setUp();
 
 		$this->Model = ClassRegistry::init('Article');
-		$this->Model->Behaviors->attach('Tools.Typographic', array('fields'=>array('body'), 'before'=>'validate'));
+		$this->Model->Behaviors->load('Tools.Typographic', array('fields'=>array('body'), 'before'=>'validate'));
 	}
 
 	public function testObject() {
@@ -59,8 +59,8 @@ class TypographicBehaviorTest extends MyCakeTestCase {
 	}
 
 	public function testMergeQuotes() {
-		$this->Model->Behaviors->detach('Typographic');
-		$this->Model->Behaviors->attach('Tools.Typographic', array('before' => 'validate', 'mergeQuotes' => true));
+		$this->Model->Behaviors->unload('Typographic');
+		$this->Model->Behaviors->load('Tools.Typographic', array('before' => 'validate', 'mergeQuotes' => true));
 		$strings = array(
 			'some string with ‹single angle quotes›' => 'some string with "single angle quotes"',
 			'other string with „German‟ quotes' => 'other string with "German" quotes',
@@ -87,8 +87,8 @@ class TypographicBehaviorTest extends MyCakeTestCase {
 	 * 2012-08-07 ms
 	 */
 	public function testAutoFields() {
-		$this->Model->Behaviors->detach('Typographic');
-		$this->Model->Behaviors->attach('Tools.Typographic');
+		$this->Model->Behaviors->unload('Typographic');
+		$this->Model->Behaviors->load('Tools.Typographic');
 		$data = array(
 			'title' => '„German‟ quotes',
 			'body' => 'mixed double “one” and «two»',
@@ -108,7 +108,7 @@ class TypographicBehaviorTest extends MyCakeTestCase {
 	}
 
 	public function testUpdateTypography() {
-		$this->Model->Behaviors->detach('Typographic');
+		$this->Model->Behaviors->unload('Typographic');
 		for ($i = 0; $i < 202; $i++) {
 			$data = array(
 				'title' => 'title '.$i,
@@ -117,7 +117,7 @@ class TypographicBehaviorTest extends MyCakeTestCase {
 			$this->Model->create();
 			$this->Model->save($data);
 		}
-		$this->Model->Behaviors->attach('Tools.Typographic');
+		$this->Model->Behaviors->load('Tools.Typographic');
 		$count = $this->Model->updateTypography();
 		$this->assertTrue($count >= 200);
 

+ 1 - 1
Test/Case/Model/CodeKeyTest.php

@@ -9,7 +9,7 @@ class CodeKeyTest extends MyCakeTestCase {
 
 	public $fixtures = array('plugin.tools.code_key');
 
-	public function startTest() {
+	public function setUp() {
 		$this->CodeKey = ClassRegistry::init('Tools.CodeKey');
 	}
 

+ 1 - 1
Test/Case/Model/ContactFormTest.php

@@ -6,7 +6,7 @@ class ContactFormTest extends CakeTestCase {
 	public $ContactForm = null;
 	//public $fixtures = array('app.code_key');
 
-	public function startTest() {
+	public function setUp() {
 		$this->ContactForm = ClassRegistry::init('Tools.ContactForm');
 	}
 

+ 1 - 1
Test/Case/Model/QloginTest.php

@@ -10,7 +10,7 @@ class QloginTest extends MyCakeTestCase {
 
 	public $fixtures = array('plugin.tools.code_key');
 
-	public function startTest() {
+	public function setUp() {
 		$this->Qlogin = ClassRegistry::init('Tools.Qlogin');
 	}
 

+ 1 - 1
Test/Case/Model/TokenTest.php

@@ -9,7 +9,7 @@ class TokenTest extends MyCakeTestCase {
 
 	public $fixtures = array('plugin.tools.token');
 
-	public function startTest() {
+	public function setUp() {
 		$this->Token = ClassRegistry::init('Tools.Token');
 	}
 

+ 1 - 1
Test/Case/View/Helper/FlattrHelperTest.php

@@ -9,7 +9,7 @@ class FlattrHelperTest extends MyCakeTestCase {
 
 	public $uid;
 
-	public function startTest() {
+	public function setUp() {
 		$this->Flattr = new FlattrHelper(new View(null));
 		$this->Flattr->Html = new HtmlHelper(new View(null));