Skip to content
Permalink
Browse files

Add test that covers the deprecated locale method.

  • Loading branch information...
ndm2
ndm2 committed Mar 12, 2018
1 parent 5e4e0e2 commit 5f7d23291cb28d4a1721e022ee0614bdbcc9d7f9
Showing with 25 additions and 0 deletions.
  1. +25 −0 tests/TestCase/ORM/Behavior/TranslateBehaviorTest.php
@@ -319,6 +319,31 @@ public function testFindSingleLocaleWithgetConditions()
$this->assertEquals($expected, $row->toArray());
}
/**
* Tests the deprecated locale method.
*
* @group deprecated
* @return void
*/
public function testLocale()
{
$this->deprecated(function () {
$table = $this->getTableLocator()->get('Articles');
$table->addBehavior('Translate');
$this->assertEquals('en_US', $table->locale());
$table->locale('fr_FR');
$this->assertEquals('fr_FR', $table->locale());
$table->locale(false);
$this->assertEquals('en_US', $table->locale());
I18n::setLocale('fr_FR');
$this->assertEquals('fr_FR', $table->locale());
});
}
/**
* Tests the locale setter/getter.
*

0 comments on commit 5f7d232

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