Skip to content

Commit

Permalink
update test to fix travis build
Browse files Browse the repository at this point in the history
  • Loading branch information
antograssiot committed Jan 31, 2016
1 parent 37503b1 commit 764f283
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions tests/TestCase/View/Helper/TimeHelperTest.php
Expand Up @@ -17,6 +17,7 @@
use Cake\Core\App;
use Cake\Core\Configure;
use Cake\Core\Plugin;
use Cake\I18n\I18n;
use Cake\I18n\Time;
use Cake\TestSuite\TestCase;
use Cake\View\Helper\TimeHelper;
Expand All @@ -42,6 +43,19 @@ public function setUp()
$this->View = new View();
$this->Time = new TimeHelper($this->View);
Time::$defaultLocale = 'en_US';
$this->locale = I18n::locale();
}

/**
* tearDown method
*
* @return void
*/
public function tearDown()
{
parent::tearDown();
Time::$defaultLocale = 'en_US';
I18n::locale($this->locale);
}

/**
Expand Down Expand Up @@ -432,14 +446,12 @@ public function testFormat()
$expected = 'Date invalid';
$this->assertEquals($expected, $result);

\Cake\I18n\I18n::locale('fr-FR');
Time::$defaultLocale = 'fr-FR';
I18n::locale('fr_FR');
Time::$defaultLocale = 'fr_FR';
$time = new \Cake\I18n\FrozenTime('Thu Jan 14 13:59:28 2010');
$result = $this->Time->format($time);
$expected = '14/01/2010 13:59';
$expected = '14/01/10 13:59';
$this->assertTimeFormat($expected, $result);
\Cake\I18n\I18n::locale('en-US');

}

/**
Expand Down

0 comments on commit 764f283

Please sign in to comment.