Skip to content
This repository has been archived by the owner on Jul 7, 2022. It is now read-only.

Commit

Permalink
Add a sanity test for the test table class
Browse files Browse the repository at this point in the history
  • Loading branch information
AD7six committed Feb 5, 2015
1 parent aaae63c commit 775b550
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/TestCase/Model/Behavior/ShadowTranslateBehaviorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,26 @@ public function setUp()
parent::setUp();
}

/**
* Make sure the test Table class addBehavior method works
*
* A sanity test to make sure that the test method to add the translate
* behavior actually adds the shadow translate behavior. If this test
* fails, all other tests should also fail (because, this test class does
* not import core.translates fixture on which the Translate behavior
* test would otherwise depend).
*
* @return void
*/
public function testTestSetup()
{
$table = TableRegistry::get('Articles');
$table->addBehavior('Translate');

$this->assertFalse($table->hasBehavior('Translate'), 'Should not be on this table');
$this->assertTrue($table->hasBehavior('ShadowTranslate'), 'Should be on this table');
}

/**
* Allow usage without specifying fields explicitly
*
Expand Down

0 comments on commit 775b550

Please sign in to comment.