/** * @dataProvider providerTextBinary * * @param string $text The WKT of the geometry under test. * @param string $bigEndianBinary The big endian WKB of the geometry under test. * @param string $littleEndianBinary The little endian WKB of the geometry under test. */ public function testAsBinary($text, $bigEndianBinary, $littleEndianBinary) { $machineByteOrder = WKBTools::getMachineByteOrder(); if ($machineByteOrder === WKBTools::BIG_ENDIAN) { $binary = $bigEndianBinary; } else { $binary = $littleEndianBinary; } $this->assertSame($binary, bin2hex(Geometry::fromText($text)->asBinary())); }
/** * Class constructor. * * @param string $wkb */ public function __construct($wkb) { $this->wkb = $wkb; $this->length = strlen($wkb); $this->machineByteOrder = WKBTools::getMachineByteOrder(); }
/** * @throws GeometryIOException */ public function __construct() { $this->byteOrder = $this->machineByteOrder = WKBTools::getMachineByteOrder(); }