public function StockLevelWidgetsTest::testLinkToTransactionFormWidget in Commerce Stock 8
Same name in this branch
- 8 modules/ui/tests/Functional/StockLevelWidgetsTest.php \Drupal\Tests\commerce_stock_ui\Functional\StockLevelWidgetsTest::testLinkToTransactionFormWidget()
- 8 modules/field/tests/src/Functional/StockLevelWidgetsTest.php \Drupal\Tests\commerce_stock_field\Functional\StockLevelWidgetsTest::testLinkToTransactionFormWidget()
Testing the commerce_stock_level_transaction_form_link widget.
File
- modules/
ui/ tests/ Functional/ StockLevelWidgetsTest.php, line 31
Class
- StockLevelWidgetsTest
- Provides tests for the stock level widget.
Namespace
Drupal\Tests\commerce_stock_ui\FunctionalCode
public function testLinkToTransactionFormWidget() {
$entity_type = "commerce_product_variation";
$bundle = 'default';
$widget_id = "commerce_stock_level_transaction_form_link";
$widget_settings = [];
$this
->configureFormDisplay($widget_id, $widget_settings, $entity_type, $bundle);
$this
->drupalGet($this->variation
->toUrl('edit-form'));
$this
->assertSession()
->statusCodeEquals(200);
$this
->assertSession()
->linkExists(t('transaction form'));
$this
->clickLink(t('transaction form'));
$this
->assertSession()
->statusCodeEquals(200);
$path = '/admin/commerce/config/stock/transactions2';
$this
->assertSession()
->addressEquals($path);
}