public function test_adjacent_strict_fractionFollows_0digit() { // succeeds because hour/min are fixed width $f = $this->builder->appendValue2(ChronoField::HOUR_OF_DAY(), 2)->appendValue2(ChronoField::MINUTE_OF_HOUR(), 2)->appendFraction(ChronoField::NANO_OF_SECOND(), 0, 3, false)->toFormatter2(Locale::UK()); $pp = new ParsePosition(0); $parsed = $f->parseUnresolved("1230", $pp); $this->assertEquals($pp->getErrorIndex(), -1); $this->assertEquals($pp->getIndex(), 4); $this->assertEquals($parsed->getLong(ChronoField::HOUR_OF_DAY()), 12); $this->assertEquals($parsed->getLong(ChronoField::MINUTE_OF_HOUR()), 30); }
/** * @expectedException \Celest\IllegalArgumentException */ public function test_appendValue_2arg_widthTooBig() { $this->builder->appendValue2(CF::DAY_OF_MONTH(), 20); }