Dates localization
This commit is contained in:
parent
b7ff480e17
commit
d0a46ee8ab
17 changed files with 35 additions and 106 deletions
|
|
@ -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
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue