Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removing ReflectionMethod::setAccessible() from tests, it was limitin…

…g to PHP 5.3.2 or newer.
  • Loading branch information...
commit 6d3bc7be86ccb512a3c9ea32048f278ef1da9390 1 parent 8e93c4c
Renan Gonçalves renan authored
Showing with 16 additions and 3 deletions.
  1. +16 −3 lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
19 lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
View
@@ -1082,15 +1082,28 @@ function &_prepareAssociationQuery($model, &$queryData, $binding) {
$linkModel = $model->{$className};
$external = isset($assocData['external']);
- $reflection = new ReflectionMethod($this->Dbo, '_scrubQueryData');
- $reflection->setAccessible(true);
- $queryData = $reflection->invokeArgs($this->Dbo, array($queryData));
+ $queryData = $this->_scrubQueryData($queryData);
$result = array_merge(array('linkModel' => &$linkModel), compact('type', 'assoc', 'assocData', 'external'));
return $result;
}
/**
+ * Helper method copied from DboSource::_scrubQueryData()
+ *
+ * @param array $data
+ * @return array
+ */
+ function _scrubQueryData($data) {
+ static $base = null;
+ if ($base === null) {
+ $base = array_fill_keys(array('conditions', 'fields', 'joins', 'order', 'limit', 'offset', 'group'), array());
+ $base['callbacks'] = null;
+ }
+ return (array)$data + $base;
+ }
+
+/**
* testGenerateInnerJoinAssociationQuery method
*
* @return void
Please sign in to comment.
Something went wrong with that request. Please try again.