/** * @dataProvider data_parseSuccess */ public function test_parseSuccess_suffix($text, $expectedIndex, $expectedErrorIndex, $expected) { $this->builder->appendZoneId(); $suffixText = $text . "XXX"; $parsed = $this->builder->toFormatter()->parseUnresolved($suffixText, $this->pos); $this->assertEquals($this->pos->getErrorIndex(), $expectedErrorIndex, "Incorrect error index parsing: " . $suffixText); $this->assertEquals($this->pos->getIndex(), $expectedIndex, "Incorrect index parsing: " . $suffixText); if ($expected !== null) { $this->assertEquals($parsed->query(TemporalQueries::zoneId()), $expected, "Incorrect zoneId parsing: " . $suffixText); $this->assertEquals($parsed->query(TemporalQueries::offset()), null, "Incorrect offset parsing: " . $suffixText); $this->assertEquals($parsed->query(TemporalQueries::zone()), $expected, "Incorrect zone parsing: " . $suffixText); } else { $this->assertEquals($parsed, null); } }
public function test_appendZoneId() { $this->builder->appendZoneId(); $f = $this->builder->toFormatter(); $this->assertEquals($f->__toString(), "ZoneId()"); }