/** * Formats duration number according to locale settings. * * Options format: * array( * 'attributes' => array( * <attribute> => <value>, * ... * ), * 'textAttributes' => array( * <attribute> => <value>, * ... * ), * 'symbols' => array( * <symbol> => <value>, * ... * ), * 'locale' => <locale> * ) * * @param float $value * @param array $options * @return string */ public function formatDuration($value, array $options = array()) { $attributes = (array) $this->getOption($options, 'attributes', array()); $textAttributes = (array) $this->getOption($options, 'textAttributes', array()); $symbols = (array) $this->getOption($options, 'symbols', array()); $locale = $this->getOption($options, 'locale'); return $this->formatter->formatDuration($value, $attributes, $textAttributes, $symbols, $locale); }
/** * @dataProvider formatDurationDataProvider */ public function testFormatDuration($expected, $value, $attributes, $textAttributes, $symbols, $locale) { $this->assertEquals($expected, $this->formatter->formatDuration($value, $attributes, $textAttributes, $symbols, $locale)); }