Permalink
Browse files

Updating for PHP5.4

- Fixing strict errors.
- Fixing call time pass by reference as its been removed in PHP5.4
- Fix assign new as a reference, which has been removed.
  • Loading branch information...
1 parent 0c0bb60 commit 0a0a09920be752b5640a2981d2b879957ae6454d @markstory markstory committed Nov 13, 2011
@@ -81,7 +81,8 @@ public function main() {
protected function _getShellList() {
$shellList = array();
- $shells = App::objects('file', App::core('Console/Command'));
+ $corePath = App::core('Console/Command');
+ $shells = App::objects('file', $corePath[0]);
$shellList = $this->_appendShells('CORE', $shells, $shellList);
$appShells = App::objects('Console/Command', null, false);
@@ -546,9 +546,10 @@ protected function _arrayDiffAssoc($array1, $array2) {
$difference[$key] = $value;
continue;
}
- $compare = strval($value);
- $correspondingValue = strval($correspondingValue);
- if ($compare === $correspondingValue) {
+ if (is_array($value) && is_array($correspondingValue)) {
+ continue;
+ }
+ if ($value === $correspondingValue) {
continue;
}
$difference[$key] = $value;
@@ -40,23 +40,6 @@ class ParamTestComponent extends Component {
* @var array
*/
public $components = array('Banana' => array('config' => 'value'));
-
-/**
- * initialize method
- *
- * @param mixed $controller
- * @param mixed $settings
- * @return void
- */
- public function initialize(&$controller, $settings) {
- foreach ($settings as $key => $value) {
- if (is_numeric($key)) {
- $this->{$value} = true;
- } else {
- $this->{$key} = $value;
- }
- }
- }
}
/**
@@ -109,7 +92,7 @@ class AppleComponent extends Component {
* @param mixed $controller
* @return void
*/
- public function startup(&$controller) {
+ public function startup($controller) {
$this->testName = $controller->name;
}
}
@@ -134,7 +117,7 @@ class OrangeComponent extends Component {
* @param mixed $controller
* @return void
*/
- public function initialize(&$controller) {
+ public function initialize($controller) {
$this->Controller = $controller;
$this->Banana->testField = 'OrangeField';
}
@@ -145,7 +128,7 @@ public function initialize(&$controller) {
* @param Controller $controller
* @return string
*/
- public function startup(&$controller) {
+ public function startup($controller) {
$controller->foo = 'pass';
}
}
@@ -170,7 +153,7 @@ class BananaComponent extends Component {
* @param Controller $controller
* @return string
*/
- public function startup(&$controller) {
+ public function startup($controller) {
$controller->bar = 'fail';
}
}
@@ -102,7 +102,7 @@ public function beforeFind($query) {
* @param array $options
* @return void
*/
- public function find($type, $options = array()) {
+ public function find($type = 'first', $options = array()) {
if ($type == 'popular') {
$conditions = array($this->name . '.' . $this->primaryKey .' > ' => '1');
$options = Set::merge($options, compact('conditions'));
@@ -27,15 +27,6 @@
class PagesControllerTest extends CakeTestCase {
/**
- * endTest method
- *
- * @return void
- */
- public function endTest() {
- App::build();
- }
-
-/**
* testDisplay method
*
* @return void
@@ -87,12 +87,12 @@ public function beforeScaffold($method) {
class TestScaffoldMock extends Scaffold {
/**
- * Overload __scaffold
+ * Overload _scaffold
*
* @param unknown_type $params
*/
- function _scaffold($params) {
- $this->_params = $params;
+ function _scaffold(CakeRequest $request) {
+ $this->_params = $request;
}
/**
@@ -64,7 +64,7 @@ class BlueberryComponent extends Component {
*
* @return void
*/
- public function initialize(&$controller) {
+ public function initialize($controller) {
$this->testName = 'BlueberryComponent';
}
}
@@ -3305,9 +3305,9 @@ public function testResetAddedAssociation() {
$this->assertTrue(empty($this->Article->hasMany['ArticlesTag']));
- $this->JoinA =& ClassRegistry::init('JoinA');
- $this->JoinB =& ClassRegistry::init('JoinB');
- $this->JoinC =& ClassRegistry::init('JoinC');
+ $this->JoinA = ClassRegistry::init('JoinA');
+ $this->JoinB = ClassRegistry::init('JoinB');
+ $this->JoinC = ClassRegistry::init('JoinC');
$this->JoinA->Behaviors->attach('Containable');
$this->JoinB->Behaviors->attach('Containable');
@@ -955,7 +955,7 @@ public function testTableParametersAndIndexComparison() {
)
)
);
- $this->assertEqual($compare, $expected);
+ $this->assertEquals($expected, $compare);
}
/**
@@ -43,7 +43,7 @@ class DboPostgresTestDb extends Postgres {
* @param mixed $sql
* @return void
*/
- function _execute($sql, $params = array()) {
+ function _execute($sql, $params = array(), $prepareOptions = array()) {
$this->simulated[] = $sql;
return null;
}
@@ -42,7 +42,7 @@ class DboSqliteTestDb extends Sqlite {
* @param mixed $sql
* @return void
*/
- function _execute($sql, $params = array()) {
+ function _execute($sql, $params = array(), $prepareOptions = array()) {
$this->simulated[] = $sql;
return null;
}
@@ -48,9 +48,11 @@ class SqlserverTestDb extends Sqlserver {
* execute method
*
* @param mixed $sql
+ * @param mixed $params
+ * @param mixed $prepareOptions
* @return mixed
*/
- protected function _execute($sql) {
+ protected function _execute($sql, $params = array(), $prepareOptions = array()) {
$this->simulated[] = $sql;
return empty($this->executeResultsStack) ? null : array_pop($this->executeResultsStack);
}
@@ -33,10 +33,10 @@ public function connect($config = array()) {
}
public function mergeAssociation(&$data, &$merge, $association, $type, $selfJoin = false) {
- return parent::_mergeAssociation(&$data, &$merge, $association, $type, $selfJoin);
+ return parent::_mergeAssociation($data, $merge, $association, $type, $selfJoin);
}
- public function setConfig($config) {
+ public function setConfig($config = array()) {
$this->config = $config;
}
@@ -35,7 +35,7 @@ class DigestHttpSocket extends HttpSocket {
* @param mixed $request
* @return void
*/
- public function request($request) {
+ public function request($request = array()) {
if ($request === false) {
if (isset($this->response['header']['WWW-Authenticate'])) {
unset($this->response['header']['WWW-Authenticate']);
@@ -192,4 +192,4 @@ public function testNoDigestResponse() {
$this->assertFalse(isset($this->HttpSocket->request['header']['Authorization']));
}
-}
+}
@@ -42,6 +42,7 @@ public function setUp() {
if (!CakeSession::started()) {
CakeSession::start();
+ var_dump('session was not started');
}
$_SESSION = array(
@@ -70,6 +71,7 @@ public function setUp() {
),
'Deeply' => array('nested' => array('key' => 'value')),
);
+ var_dump($_SESSION);
}
/**

0 comments on commit 0a0a099

Please sign in to comment.