public function EnforcementBrowserTest::testOutOfStock in Commerce Stock 8
Test that the out of stock button is displayed.
File
- modules/
enforcement/ tests/ src/ Functional/ EnforcementBrowserTest.php, line 42  
Class
- EnforcementBrowserTest
 - Tests out of stock functionality.
 
Namespace
Drupal\Tests\commerce_stock_enforcement\FunctionalCode
public function testOutOfStock() {
  $this->stockServiceManager
    ->createTransaction($this->variation, $this->locations[1]
    ->getId(), '', -10, 12.12, 'USD', StockTransactionsInterface::STOCK_OUT, []);
  $this
    ->drupalGet('product/' . $this->product
    ->id());
  $this
    ->assertSession()
    ->buttonExists('Out of stock');
}