Dates localization

This commit is contained in:
Dmitry Khomutov 2017-01-15 17:28:15 +07:00
commit d0a46ee8ab
No known key found for this signature in database
GPG key ID: 7EB36C9576F9ECB9
17 changed files with 35 additions and 106 deletions

View file

@ -16,24 +16,6 @@ use Tests\PHPCensor\LocalizationTestCase;
class LangTest extends LocalizationTestCase
{
public function testLang_UsePassedParameters()
{
$dateTime = $this->prophesize('DateTime');
$dateTime->format(DateTime::ISO8601)->willReturn("ISODATE");
$dateTime->format(DateTime::RFC2822)->willReturn("RFCDATE");
$this->assertEquals('<time datetime="ISODATE" data-format="FORMAT">RFCDATE</time>', Lang::formatDateTime($dateTime->reveal(), 'FORMAT'));
}
public function testLang_UseDefaultFormat()
{
$dateTime = $this->prophesize('DateTime');
$dateTime->format(DateTime::ISO8601)->willReturn("ISODATE");
$dateTime->format(DateTime::RFC2822)->willReturn("RFCDATE");
$this->assertEquals('<time datetime="ISODATE" data-format="lll">RFCDATE</time>', Lang::formatDateTime($dateTime->reveal()));
}
/**
* @return array
*/