Skip to content
Permalink
Browse files

fix tests after rebase

  • Loading branch information...
AD7six committed Nov 10, 2013
1 parent 5729146 commit 30de95db54e3cf9ea6867491d7efe0553c420173
Showing with 37 additions and 19 deletions.
  1. +36 −14 Cake/Test/TestCase/ORM/BehaviorTest.php
  2. +1 −5 Cake/Test/TestCase/ORM/TableTest.php
@@ -82,6 +82,7 @@ public function doSomething() {
* verifySettings
*/
public function verifySettings() {
parent::verifySettings();
}
/**
@@ -276,43 +277,63 @@ public function testImplementedFindersDisabled() {
}
/**
* testImplementedFinderInvalid
* testVerifySettings
*
* @expectedException Cake\Error\Exception
* @expectedExceptionMessage The method findNotDefined is not callable on class Cake\Test\TestCase\ORM\Test2Behavior
* Don't expect an exception to be thrown
*
* @return void
*/
public function testImplementedFinderInvalid() {
public function testVerifySettings() {
$table = $this->getMock('Cake\ORM\Table');
$behavior = new Test2Behavior($table);
$behavior->verifySettings();
$this->assertTrue(true, 'No exception thrown');
}
/**
* testVerifySettingsImplementedFindersOverriden
*
* Simply don't expect an exception to be thrown
*
* @return void
*/
public function testVerifySettingsImplementedFindersOverriden() {
$table = $this->getMock('Cake\ORM\Table');
$behavior = new Test2Behavior($table, [
'implementedFinders' => [
'aliased' => 'findNotDefined'
'aliased' => 'findFoo'
]
]);
$behavior->verifySettings();
$this->assertTrue(true, 'No exception thrown');
}
/**
* testImplementedMethods
* testVerifyImplementedFindersInvalid
*
* Simply don't expect an exception to be thrown
* @expectedException Cake\Error\Exception
* @expectedExceptionMessage The method findNotDefined is not callable on class Cake\Test\TestCase\ORM\Test2Behavior
*
* @return void
*/
public function testVerifySettings() {
public function testVerifyImplementedFindersInvalid() {
$table = $this->getMock('Cake\ORM\Table');
$behavior = new Test2Behavior($table);
$behavior = new Test2Behavior($table, [
'implementedFinders' => [
'aliased' => 'findNotDefined'
]
]);
$behavior->verifySettings();
}
/**
* testImplementedMethodsOverriden
* testVerifySettingsImplementedMethodsOverriden
*
* Simply don't expect an exception to be thrown
* Don't expect an exception to be thrown
*
* @return void
*/
public function testVerifySettingsOverriden() {
public function testVerifySettingsImplementedMethodsOverriden() {
$table = $this->getMock('Cake\ORM\Table');
$behavior = new Test2Behavior($table);
$behavior = new Test2Behavior($table, [
@@ -321,17 +342,18 @@ public function testVerifySettingsOverriden() {
]
]);
$behavior->verifySettings();
$this->assertTrue(true, 'No exception thrown');
}
/**
* testImplementedMethodsInvalid
* testVerifyImplementedMethodsInvalid
*
* @expectedException Cake\Error\Exception
* @expectedExceptionMessage The method iDoNotExist is not callable on class Cake\Test\TestCase\ORM\Test2Behavior
*
* @return void
*/
public function testVerifySettingsInvalid() {
public function testVerifyImplementedMethodsInvalid() {
$table = $this->getMock('Cake\ORM\Table');
$behavior = new Test2Behavior($table, [
'implementedMethods' => [
@@ -1015,13 +1015,9 @@ public function testCallBehaviorFinder() {
* @return void
*/
public function testCallBehaviorAliasedFinder() {
$table = TableRegistry::get('article');
$table = TableRegistry::get('articles');
$table->addBehavior('Sluggable', ['implementedFinders' => ['special' => 'findNoSlug']]);
$query = $table->special();
$this->assertInstanceOf('Cake\ORM\Query', $query);
$this->assertNotEmpty($query->clause('where'));
$query = $table->find('special');
$this->assertInstanceOf('Cake\ORM\Query', $query);
$this->assertNotEmpty($query->clause('where'));

0 comments on commit 30de95d

Please sign in to comment.
You can’t perform that action at this time.