Skip to content

Commit

Permalink
Adding failing test for query throwing fatal error
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Jan 25, 2015
1 parent f634ce5 commit 32a937e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/TestCase/ORM/QueryRegressionTest.php
Expand Up @@ -696,4 +696,18 @@ public function testFindMatchingOverwrite2()

$this->assertNotNull($result->article->author);
}


/**
* Tests that trying to contain an inexistent association
* throws an exception and not a fatal error.
*
* @expectedException RuntimeException
* @return void
*/
public function testQueryNotFatalError()
{
$comments = TableRegistry::get('Comments');
$comments->find()->contain('Deprs')->all();
}
}

0 comments on commit 32a937e

Please sign in to comment.