コード例 #1
0
 public function testCanRenderTextDelimiters()
 {
     $element = new DateTimeSelect('foo');
     $element->setShouldCreateEmptyOption(true);
     $element->setShouldRenderDelimiters(true);
     $element->setShouldShowSeconds(true);
     $markup = $this->helper->__invoke($element, \IntlDateFormatter::LONG, \IntlDateFormatter::LONG, 'pt_BR');
     // pattern === "d 'de' MMMM 'de' y HH'h'mm'min'ss's'"
     $this->assertStringMatchesFormat('%a de %a de %a %ah%amin%as', $markup);
 }
コード例 #2
0
 public function testNoMinutesDelimiterIfSecondsNotShown()
 {
     $element = new DateTimeSelect('foo');
     $element->setValue(array('year' => '2012', 'month' => '09', 'day' => '24', 'hour' => '03', 'minute' => '04', 'second' => '59'));
     $element->setShouldShowSeconds(false);
     $element->shouldRenderDelimiters(true);
     $markup = $this->helper->__invoke($element);
     // the last $markup char should be the '>' of the minutes  html select
     // closing tag and not the delimiter
     $this->assertEquals('>', substr($markup, -1));
 }