You are here

public function ProductBundleStockProxyKernelTest::testProductBundleStockProxy in Commerce Product Bundle 8

Tests the product bundle proxy.

@covers ::getIsStockManaged @covers ::getIsAlwaysInStock @covers ::getIsInStock

@todo Add tests with real stock checking.

File

modules/commerce_product_bundle_stock/tests/src/Kernel/ProductBundleStockProxyKernelTest.php, line 115

Class

ProductBundleStockProxyKernelTest
Tests the product bundle stock proxy.

Namespace

Drupal\Tests\commerce_product_bundle_stock\Kernel

Code

public function testProductBundleStockProxy() {
  $stockServiceManager = \Drupal::service('commerce_stock.service_manager');
  $proxy = new ProductBundleStockProxy($stockServiceManager);
  $this
    ->assertTrue($proxy
    ->getIsStockManaged($this->bundle));
  $this
    ->assertTrue($proxy
    ->getIsAlwaysInStock($this->bundle));
  $this
    ->assertTrue($proxy
    ->getIsInStock($this->bundle, []));
}