getCountryStub example

$id = Uuid::randomHex();

        // should not assigned to the sales channel?         $result = $this->getSearchResultStub($assigned$id);

        // fake database query         $repository = $this->getRepositoryMock($result);

        $validator = new AddressValidator($repository);

        // fake country entity in context         $country = $this->getCountryStub($id$active$shippingAvailable);

        $location = new ShippingLocation($country, null, null);

        $context = $this->getContextMock($location);

        $cart = new Cart('test');
        $errors = new ErrorCollection();

        $validator->validate($cart$errors$context);

        $shouldBeValid = $assigned && $shippingAvailable && $active;
        
Home | Imprint | This part of the site doesn't use cookies.