Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix failing tests caused by incorrect mocks.

  • Loading branch information...
commit d63d51e3dd8ab502e853b71d313b5607be36837a 1 parent 2e8498e
@markstory markstory authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
View
9 lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
@@ -917,7 +917,10 @@ public function testGetEncoding() {
* @return void
*/
public function testFieldDoubleEscaping() {
+ $db = $this->Dbo->config['database'];
$test = $this->getMock('Mysql', array('connect', '_execute', 'execute'));
+ $test->config['database'] = $db;
+
$this->Model = $this->getMock('Article2', array('getDataSource'));
$this->Model->alias = 'Article';
$this->Model->expects($this->any())
@@ -1096,7 +1099,10 @@ function &_prepareAssociationQuery($model, &$queryData, $binding) {
* @return void
*/
public function testGenerateInnerJoinAssociationQuery() {
+ $db = $this->Dbo->config['database'];
$test = $this->getMock('Mysql', array('connect', '_execute', 'execute'));
+ $test->config['database'] = $db;
+
$this->Model = $this->getMock('TestModel9', array('getDataSource'));
$this->Model->expects($this->any())
->method('getDataSource')
@@ -2910,7 +2916,10 @@ public function testBuildColumnBadType() {
* @return void
*/
public function testHasAny() {
+ $db = $this->Dbo->config['database'];
$this->Dbo = $this->getMock('Mysql', array('connect', '_execute', 'execute', 'value'));
+ $this->Dbo->config['database'] = $db;
+
$this->Model = $this->getMock('TestModel', array('getDataSource'));
$this->Model->expects($this->any())
->method('getDataSource')

0 comments on commit d63d51e

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