<commit_before><?php

/*
 * This file is part of the Sylius package.
 *
 * (c) <NAME>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace spec\Sylius\Component\Order\Updater;

use PhpSpec\ObjectBehavior;
use SM\Factory\Factory;
use SM\StateMachine\StateMachineInterface;
use Sylius\Component\Order\Model\OrderInterface;
use Sylius\Component\Order\OrderTransitions;
use Sylius\Component\Order\Repository\OrderRepositoryInterface;
use Sylius\Component\Order\Updater\UnpaidOrdersStateUpdater;
use Sylius\Component\Order\Updater\UnpaidOrdersStateUpdaterInterface;

/**
 * @author <NAME> <<EMAIL>>
 *
 * @mixin UnpaidOrdersStateUpdater
 */
final class UnpaidOrdersStateUpdaterSpec extends ObjectBehavior
{
    function let(OrderRepositoryInterface $orderRepository, Factory $stateMachineFactory)
    {
        $this->beConstructedWith($orderRepository, $stateMachineFactory, '10 months');
    }

    function it_is_initializable()
    {
        $this->shouldHaveType(UnpaidOrdersStateUpdater::class);
    }

    function it_implements_expired_orders_state_updater_interface()
    {
        $this->shouldImplement(UnpaidOrdersStateUpdaterInterface::class);
    }

    function it_cancels_unpaid_orders(
        Factory $stateMachineFactory,
        OrderInterface $firstOrder,
        OrderInterface $secondOrder,
        OrderRepositoryInterface $orderRepository,
        StateMachineInterface $firstOrderStateMachine,
        StateMachineInterface $secondOrderStateMachine
    ) {
        $orderRepository->findOrdersUnpaidSince(new \DateTime('-10 months'))->willReturn([
           $firstOrder,<commit_msg>Fix fragile spec<commit_after><?php

/*
 * This file is part of the Sylius package.
 *
 * (c) <NAME>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace spec\Sylius\Component\Order\Updater;

use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
use SM\Factory\Factory;
use SM\StateMachine\StateMachineInterface;
use Sylius\Component\Order\Model\OrderInterface;
use Sylius\Component\Order\OrderTransitions;
use Sylius\Component\Order\Repository\OrderRepositoryInterface;
use Sylius\Component\Order\Updater\UnpaidOrdersStateUpdater;
use Sylius\Component\Order\Updater\UnpaidOrdersStateUpdaterInterface;

/**
 * @author <NAME> <<EMAIL>>
 *
 * @mixin UnpaidOrdersStateUpdater
 */
final class UnpaidOrdersStateUpdaterSpec extends ObjectBehavior
{
    function let(OrderRepositoryInterface $orderRepository, Factory $stateMachineFactory)
    {
        $this->beConstructedWith($orderRepository, $stateMachineFactory, '10 months');
    }

    function it_is_initializable()
    {
        $this->shouldHaveType(UnpaidOrdersStateUpdater::class);
    }

    function it_implements_expired_orders_state_updater_interface()
    {
        $this->shouldImplement(UnpaidOrdersStateUpdaterInterface::class);
    }

    function it_cancels_unpaid_orders(
        Factory $stateMachineFactory,
        OrderInterface $firstOrder,
        OrderInterface $secondOrder,
        OrderRepositoryInterface $orderRepository,
        StateMachineInterface $firstOrderStateMachine,
        StateMachineInterface $secondOrderStateMachine
    ) {
        $orderRepository->findOrdersUnpaidSince(Argument::type(\DateTime::class))->willReturn([
           $firstOrder,
{'fraction_non_alphanumeric': 0.08851884312007012, 'fraction_numerical': 0.0017528483786152498, 'mean_word_length': 4.567479674796748, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2278455', 'n_tokens_mistral': 965, 'n_tokens_neox': 978, 'n_words': 183}