IsCompanyRule example

/** * @covers \Shopware\Core\Checkout\Customer\Rule\IsCompanyRule * * @internal */
#[Package('business-ops')] class IsCompanyCustomerRuleTest extends TestCase
{
    public function testThatNonExistingCustomerDoesNotMatch(): void
    {
        $this->matchRuleWithCustomer(new IsCompanyRule(true), null, false);
        $this->matchRuleWithCustomer(new IsCompanyRule(false), null, false);
    }

    public function testThatCustomerWithCompanyMatchesCorrectly(): void
    {
        $customer = new CustomerEntity();
        $customer->setCompany('shopware AG');

        $this->matchRuleWithCustomer(new IsCompanyRule(true)$customer, true);
        $this->matchRuleWithCustomer(new IsCompanyRule(false)$customer, false);
    }

    
Home | Imprint | This part of the site doesn't use cookies.