Skip to content

Commit

Permalink
Fix failing tests caused by incorrect mocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Dec 12, 2011
1 parent 2e8498e commit d63d51e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
Expand Up @@ -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())
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit d63d51e

Please sign in to comment.