You are here

public function WktGeneratorTest::testPoint in Geofield 8

Tests the generation of WKT points and multipoints.

File

tests/src/Kernel/WktGeneratorTest.php, line 81

Class

WktGeneratorTest
Tests WktGenerator.

Namespace

Drupal\Tests\geofield\Kernel

Code

public function testPoint() {
  $point = $this->wktGenerator
    ->wktGeneratePoint([
    '3',
    '4',
  ]);
  $this
    ->assertEquals('POINT (3 4)', $point, 'Point generated properly');
  $point = $this->wktGenerator
    ->wktGeneratePoint();
  $match = preg_match($this->pointRegex, $point);
  $this
    ->assertNotEmpty($match, 'Point generated properly');
  $multipoint = $this->wktGenerator
    ->wktGenerateMultipoint();
  $match = preg_match($this->multipointRegex, $multipoint);
  $this
    ->assertNotEmpty($match, 'Multipoint generated properly');
}