public function PurchasedEntityConditionTest::testDerivative in Commerce Core 8.2
Tests the condition derivatives.
@dataProvider derivativeData
Parameters
string $base_plugin_id: The base plugin ID.
string $purchasable_entity_type_id: The purchasable entity type ID.
string $expected_label: The expected plugin label.
File
- modules/
order/ tests/ src/ Kernel/ Plugin/ Commerce/ Condition/ PurchasedEntityConditionTest.php, line 27
Class
- PurchasedEntityConditionTest
- Tests the purchased entity order conditions.
Namespace
Drupal\Tests\commerce_order\Kernel\Plugin\Commerce\ConditionCode
public function testDerivative(string $base_plugin_id, string $purchasable_entity_type_id, string $expected_label) {
$plugin_manager = $this->container
->get('plugin.manager.commerce_condition');
$plugin = $plugin_manager
->getDefinition($base_plugin_id . PluginBase::DERIVATIVE_SEPARATOR . $purchasable_entity_type_id);
$this
->assertNotNull($plugin);
$this
->assertEquals($expected_label, $plugin['label']);
$this
->assertEquals($purchasable_entity_type_id, $plugin['purchasable_entity_type']);
}