<?php

declare(strict_types=1);

use FiloBlu\Storelocator\Helper\Data;
use Magento\Framework\App\Area;
use Magento\Framework\App\Bootstrap;
use Magento\Framework\App\State;
use Magento\Quote\Model\Quote;

require __DIR__ . '/../../../../../app/bootstrap.php';
$params = $_SERVER;
$bootstrap = Bootstrap::create(BP, $params);
$objectManager = $bootstrap->getObjectManager();
$state = $objectManager->get(State::class);
$state->setAreaCode(Area::AREA_FRONTEND);

/** @var \FiloBlu\Storelocator\Helper\Data $helper */
$helper = $objectManager->create(Data::class);

// Mockup a quote

/** @var \Magento\Quote\Model\Quote|\Magento\Quote\Api\Data\CartInterface $quote */
$quote = $objectManager->create(Quote::class, [
    'data' => [
        'pickup_in_store_id' => 147
    ]
]);

$required =$helper->canSendEmailToStore($quote);

/** @var \Magento\Quote\Model\Quote|\Magento\Quote\Api\Data\CartInterface $quote */
$quote = $objectManager->create(Quote::class, [
    'data' => [
        'pickup_in_store_code' => 'TEST'
    ]
]);

$required =$helper->canSendEmailToStore($quote);

