You are here

public function StockLocationTest::testStockLocation in Commerce Stock 8

Test stock location.

@covers ::getName @covers ::setName @covers ::isActive @covers ::setActive

File

modules/local_storage/tests/src/Kernel/Entity/StockLocationTest.php, line 54

Class

StockLocationTest
Test the StockLocation entity.

Namespace

Drupal\Tests\commerce_stock_local\Kernel\Entity

Code

public function testStockLocation() {
  $location = StockLocation::create([
    'type' => 'default',
  ]);
  $location
    ->setName('TestName');
  self::assertEquals('TestName', $location
    ->getName());
  self::assertTrue($location
    ->isActive());
  $location
    ->setActive(FALSE);
  self::assertFalse($location
    ->isActive());
  $location
    ->setActive(TRUE);
  self::assertTrue($location
    ->isActive());
}