Set the parser that should be used to manage this coordinate
public setParser ( Treffynnon\Navigator\Coordinate\ParserInterface $parser ) | ||
$parser | Treffynnon\Navigator\Coordinate\ParserInterface |
/** * @dataProvider coordInvalidLongProvider * @expectedException Treffynnon\Navigator\Exception\InvalidCoordinateValueException */ public function testInvalidSetLongCoordinate($coord) { $Coordinate = new N\Coordinate(); // must set a parser and direction $Coordinate->setParser(new C\DecimalParser(N::LONG)); $Coordinate->set($coord); $coord_out = (string) $Coordinate; $this->assertInternalType('string', $coord_out); $this->assertEquals($coord, $coord_out, '', 0.2); }
/** * @expectedException PHPUnit_Framework_Error */ public function testIncorrectParser() { $Coordinate = new N\Coordinate(); $Coordinate->setParser(new stdClass()); }