You are here

public function LocationTest::testComputedAssetLocation in farmOS 2.x

Test computed asset location.

File

modules/core/location/tests/src/Functional/LocationTest.php, line 55

Class

LocationTest
Tests for farmOS location logic.

Namespace

Drupal\Tests\farm_location\Functional

Code

public function testComputedAssetLocation() {

  // The computed location of the asset is the location asset.
  $location = $this->asset
    ->get('location')
    ->referencedEntities();
  $this
    ->assertEquals($this->location
    ->id(), $location[0]
    ->id(), 'Computed asset location is the location asset.');

  // The computed geometry of the asset is the location asset geometry.
  $this
    ->assertEquals($this->location
    ->get('intrinsic_geometry')->value, $this->asset
    ->get('geometry')->value, 'Computed asset geometry is the location asset geometry.');
}