LineItemStockRule example

/** * @package business-ops * * @internal * * @covers \Shopware\Core\Checkout\Cart\Rule\LineItemStockRule */
class LineItemStockRuleTest extends TestCase
{
    public function testItReturnsTheCorrectName(): void
    {
        static::assertEquals('cartLineItemStock', (new LineItemStockRule())->getName());
    }

    public function testRulesDoesNotMatchIfScopeNoLineItemScopeNorCartRuleScope(): void
    {
        $rule = new LineItemStockRule();

        static::assertFalse($rule->match($this->createMock(RuleScope::class)));
    }

    public function testItThrowsUnsupportedValueExceptionIfStockIsNotSet(): void
    {
        
Home | Imprint | This part of the site doesn't use cookies.