diff --git a/lib/Cake/Console/Command/TestShell.php b/lib/Cake/Console/Command/TestShell.php index fe6cfd873..4dfacfdfc 100644 --- a/lib/Cake/Console/Command/TestShell.php +++ b/lib/Cake/Console/Command/TestShell.php @@ -222,6 +222,7 @@ class TestShell extends Shell { $options = array(); $params = $this->params; unset($params['help']); + unset($params['quiet']); if (!empty($params['no-colors'])) { unset($params['no-colors'], $params['colors']); diff --git a/lib/Cake/Model/Datasource/Session/DatabaseSession.php b/lib/Cake/Model/Datasource/Session/DatabaseSession.php index a9c6e8627..81cd708e8 100644 --- a/lib/Cake/Model/Datasource/Session/DatabaseSession.php +++ b/lib/Cake/Model/Datasource/Session/DatabaseSession.php @@ -89,7 +89,7 @@ class DatabaseSession implements CakeSessionHandlerInterface { */ public function read($id) { $row = $this->_model->find('first', array( - 'conditions' => array($this->_model->primaryKey => $id) + 'conditions' => array($this->_model->alias . '.' . $this->_model->primaryKey => $id) )); if (empty($row[$this->_model->alias]['data'])) { diff --git a/lib/Cake/Model/Model.php b/lib/Cake/Model/Model.php index 23f39d7cc..254b31492 100644 --- a/lib/Cake/Model/Model.php +++ b/lib/Cake/Model/Model.php @@ -3076,7 +3076,7 @@ class Model extends Object implements CakeEventListener { $query['order'] = $this->order; } - $query['order'] = array($query['order']); + $query['order'] = (array)$query['order']; if ($query['callbacks'] === true || $query['callbacks'] === 'before') { $event = new CakeEvent('Model.beforeFind', $this, array($query)); diff --git a/lib/Cake/Test/Case/Console/Command/TestShellTest.php b/lib/Cake/Test/Case/Console/Command/TestShellTest.php index 132f6ed1e..d3d379a1d 100644 --- a/lib/Cake/Test/Case/Console/Command/TestShellTest.php +++ b/lib/Cake/Test/Case/Console/Command/TestShellTest.php @@ -341,4 +341,22 @@ class TestShellTest extends CakeTestCase { ); $this->Shell->main(); } + +/** + * Tests that the 'quiet' parameter gets swallowed before calling PHPUnit + * + * @return void + */ + public function testRunnerOptionsQuiet() { + $this->Shell->startup(); + $this->Shell->args = array('core', 'Basics'); + $this->Shell->params = array('quiet' => true); + + $this->Shell->expects($this->once())->method('_run') + ->with( + array('app' => false, 'plugin' => null, 'core' => true, 'output' => 'text', 'case' => 'Basics'), + array('--colors') + ); + $this->Shell->main(); + } } diff --git a/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php b/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php index fbcccc266..087b92029 100644 --- a/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php @@ -361,13 +361,13 @@ class PaginatorComponentTest extends CakeTestCase { $Controller->request->params['named'] = array('sort' => 'NotExisting.field', 'direction' => 'desc', 'limit' => 2); $Controller->Paginator->paginate('PaginatorControllerPost'); $this->assertEquals(1, $Controller->params['paging']['PaginatorControllerPost']['page']); - $this->assertEquals(array(), $Controller->PaginatorControllerPost->lastQueries[1]['order'][0], 'no order should be set.'); + $this->assertEquals(array(), $Controller->PaginatorControllerPost->lastQueries[1]['order'], 'no order should be set.'); $Controller->request->params['named'] = array( 'sort' => 'PaginatorControllerPost.author_id', 'direction' => 'allYourBase' ); $results = Hash::extract($Controller->Paginator->paginate('PaginatorControllerPost'), '{n}.PaginatorControllerPost.id'); - $this->assertEquals(array('PaginatorControllerPost.author_id' => 'asc'), $Controller->PaginatorControllerPost->lastQueries[0]['order'][0]); + $this->assertEquals(array('PaginatorControllerPost.author_id' => 'asc'), $Controller->PaginatorControllerPost->lastQueries[0]['order']); $this->assertEquals(array(1, 3, 2), $results); $Controller->request->params['named'] = array(); diff --git a/lib/Cake/Test/Case/Model/ModelReadTest.php b/lib/Cake/Test/Case/Model/ModelReadTest.php index 255371253..e592a42a3 100644 --- a/lib/Cake/Test/Case/Model/ModelReadTest.php +++ b/lib/Cake/Test/Case/Model/ModelReadTest.php @@ -6309,9 +6309,7 @@ class ModelReadTest extends BaseModelTest { 'joins' => array(), 'limit' => null, 'offset' => null, - 'order' => array( - 0 => null - ), + 'order' => array(), 'page' => 1, 'group' => null, 'callbacks' => true, @@ -8079,8 +8077,8 @@ class ModelReadTest extends BaseModelTest { /** * test after find callback on related model - * - * @return void + * + * @return void */ public function testRelatedAfterFindCallback() { $this->loadFixtures('Something', 'SomethingElse', 'JoinThing');