<commit_before><?php

namespace spec\PhpSpec\Wrapper;

use PhpSpec\Formatter\Presenter\PresenterInterface;
use PhpSpec\Exception\Example\FailureException;
use PhpSpec\Event\ExpectationEvent;
use PhpSpec\Loader\Node\ExampleNode;
use PhpSpec\Matcher\MatcherInterface;
use PhpSpec\ObjectBehavior;
use PhpSpec\Runner\MatcherManager;
use PhpSpec\Wrapper\Unwrapper;
Use Prophecy\Argument;
use RuntimeException;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;

class SubjectSpec extends ObjectBehavior
{
    function let(MatcherManager $matchers, Unwrapper $unwrapper,
        PresenterInterface $presenter, EventDispatcherInterface $dispatcher, ExampleNode $example)
    {
        $this->beConstructedWith(new \Exception(), $matchers, $unwrapper, $presenter, $dispatcher, $example);
    }

    function it_dispatches_expectation_events_for_should(MatcherManager $matchers,
        Unwrapper $unwrapper, EventDispatcherInterface $dispatcher, MatcherInterface $matcher)
    {
        $unwrapper->unwrapOne(Argument::any())->willReturn(null);
        $unwrapper->unwrapAll(Argument::any())->willReturn(array());
        $matchers->find(Argument::any(), Argument::any(), Argument::any())->shouldBeCalled()->WillReturn($matcher);

        $dispatcher->dispatch(
            'beforeExpectation',
            Argument::type('PhpSpec\Event\ExpectationEvent')
        )->shouldBeCalled();

        $dispatcher->dispatch(
            'afterExpectation',
            Argument::which('getResult', ExpectationEvent::PASSED)
        )->shouldBeCalled();

        $this->callOnWrappedObject('should', array('beBoolean'));
    }

    function it_dispatches_after_expectation_event_with_failed_status_if_matcher_throws_exception_for_should(
        MatcherManager $matchers, Unwrapper $unwrapper, EventDispatcherInterface $dispatcher,
        MatcherInterface $matcher)
    {
        $unwrapper->unwrapOne(Argument::any())->willReturn(null);
        $unwrapper->unwrapAll(Argument::any())->willReturn(array());
        $matchers->find(Argument::any(), Argument::any(), Argument::any())->shouldBeCalled()->WillReturn($matcher);
        $matcher->positiveMatch(Argument::any(), Argument::any(), Argument::any())
            ->willThrow('PhpSpec\Exception\Example\FailureException');

        $dispatcher->dispatch(
            'beforeExpectation',
            Argument::type('PhpSpec\Event\ExpectationEvent')
        )->shouldBeCalled();

        $dispatcher->dispatch(
            'afterExpectation',
            Argument::which('getResult', ExpectationEvent::FAILED)
        )->shouldBeCalled();

        try {
            $this->callOnWrappedObject('should', array('beBoolean'));
        } catch (FailureException $e) {

        }
    }

    function it_dispatches_after_expectation_event_with_broken_status_if_throws_exception_for_should(
        MatcherManager $matchers, Unwrapper $unwrapper, EventDispatcherInterface $dispatcher,
        MatcherInterface $matcher)
    {
        $unwrapper->unwrapOne(Argument::any())->willReturn(null);
        $unwrapper->unwrapAll(Argument::any())->willReturn(array());
        $matchers->find(Argument::any(), Argument::any(), Argument::any())->shouldBeCalled()->WillReturn($matcher);
        $matcher->positiveMatch(Argument::any(), Argument::any(), Argument::any())
            ->willThrow('RuntimeException');

        $dispatcher->dispatch(
            'beforeExpectation',
            Argument::type('PhpSpec\Event\ExpectationEvent')
        )->shouldBeCalled();

        $dispatcher->dispatch(
            'afterExpectation',
            Argument::which('getResult', ExpectationEvent::BROKEN)
        )->shouldBeCalled();

        try {
            $this->callOnWrappedObject('should', array('beBoolean'));
        } catch (RuntimeException $e) {

        }
    }

    function it_dispatches_expectation_events_for_should_not(MatcherManager $matchers,
        Unwrapper $unwrapper, EventDispatcherInterface $dispatcher, MatcherInterface $matcher)
    {
        $unwrapper->unwrapOne(Argument::any())->willReturn(null);
        $unwrapper->unwrapAll(Argument::any())->willReturn(array());
        $matchers->find(Argument::any(), Argument::any(), Argument::any())->shouldBeCalled()->WillReturn($matcher);

        $dispatcher->dispatch(
            'beforeExpectation',
            Argument::type('PhpSpec\Event\ExpectationEvent')
        )->shouldBeCalled();

        $dispatcher->dispatch(
            'afterExpectation',
            Argument::which('getResult', ExpectationEvent::PASSED)
        )->shouldBeCalled();

        $this->callOnWrappedObject('shouldNot', array('beBoolean'));
    }

    function it_dispatches_after_expectation_event_with_failed_status_if_matcher_throws_exception_for_should_not(
        MatcherManager $matchers, Unwrapper $unwrapper, EventDispatcherInterface $dispatcher,
        MatcherInterface $matcher)
    {
        $unwrapper->unwrapOne(Argument::any())->willReturn(null);
        $unwrapper->unwrapAll(Argument::any())->willReturn(array());
        $matchers->find(Argument::any(), Argument::any(), Argument::any())->shouldBeCalled()->WillReturn($matcher);
        $matcher->negativeMatch(Argument::any(), Argument::any(), Argument::any())
            ->willThrow('PhpSpec\Exception\Example\FailureException');

        $dispatcher->dispatch(
            'beforeExpectation',
            Argument::type('PhpSpec\Event\ExpectationEvent')
        )->shouldBeCalled();

        $dispatcher->dispatch(
            'afterExpectation',
            Argument::which('getResult', ExpectationEvent::FAILED)
        )->shouldBeCalled();

        try {
            $this->callOnWrappedObject('shouldNot', array('beBoolean'));
        } catch (FailureException $e) {

        }
    }

    function it_dispatches_after_expectation_event_with_broken_status_if_throws_exception_for_should_not(
        MatcherManager $matchers, Unwrapper $unwrapper, EventDispatcherInterface $dispatcher,
        MatcherInterface $matcher)
    {
        $unwrapper->unwrapOne(Argument::any())->willReturn(null);
        $unwrapper->unwrapAll(Argument::any())->willReturn(array());
        $matchers->find(Argument::any(), Argument::any(), Argument::any())->shouldBeCalled()->WillReturn($matcher);
        $matcher->negativeMatch(Argument::any(), Argument::any(), Argument::any())
            ->willThrow('RuntimeException');

        $dispatcher->dispatch(
            'beforeExpectation',
            Argument::type('PhpSpec\Event\ExpectationEvent')
        )->shouldBeCalled();

        $dispatcher->dispatch(
            'afterExpectation',
            Argument::which('getResult', ExpectationEvent::BROKEN)
        )->shouldBeCalled();

        try {
            $this->callOnWrappedObject('shouldNot', array('beBoolean'));
        } catch (RuntimeException $e) {

        }
    }

    function it_dispatches_method_call_events(EventDispatcherInterface $dispatcher, Unwrapper $unwrapper)
    {
        $unwrapper->unwrapOne(Argument::any())->willReturn(new \Exception);
        $unwrapper->unwrapAll(Argument::any())->willReturn(array());
<commit_msg>Change multiple Argument::Any() to Argument::cetera()<commit_after><?php

namespace spec\PhpSpec\Wrapper;

use PhpSpec\Formatter\Presenter\PresenterInterface;
use PhpSpec\Exception\Example\FailureException;
use PhpSpec\Event\ExpectationEvent;
use PhpSpec\Loader\Node\ExampleNode;
use PhpSpec\Matcher\MatcherInterface;
use PhpSpec\ObjectBehavior;
use PhpSpec\Runner\MatcherManager;
use PhpSpec\Wrapper\Unwrapper;
Use Prophecy\Argument;
use RuntimeException;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;

class SubjectSpec extends ObjectBehavior
{
    function let(MatcherManager $matchers, Unwrapper $unwrapper,
        PresenterInterface $presenter, EventDispatcherInterface $dispatcher, ExampleNode $example)
    {
        $this->beConstructedWith(new \Exception(), $matchers, $unwrapper, $presenter, $dispatcher, $example);
    }

    function it_dispatches_expectation_events_for_should(MatcherManager $matchers,
        Unwrapper $unwrapper, EventDispatcherInterface $dispatcher, MatcherInterface $matcher)
    {
        $unwrapper->unwrapOne(Argument::any())->willReturn(null);
        $unwrapper->unwrapAll(Argument::any())->willReturn(array());
        $matchers->find(Argument::cetera())->shouldBeCalled()->WillReturn($matcher);

        $dispatcher->dispatch(
            'beforeExpectation',
            Argument::type('PhpSpec\Event\ExpectationEvent')
        )->shouldBeCalled();

        $dispatcher->dispatch(
            'afterExpectation',
            Argument::which('getResult', ExpectationEvent::PASSED)
        )->shouldBeCalled();

        $this->callOnWrappedObject('should', array('beBoolean'));
    }

    function it_dispatches_after_expectation_event_with_failed_status_if_matcher_throws_exception_for_should(
        MatcherManager $matchers, Unwrapper $unwrapper, EventDispatcherInterface $dispatcher,
        MatcherInterface $matcher)
    {
        $unwrapper->unwrapOne(Argument::any())->willReturn(null);
        $unwrapper->unwrapAll(Argument::any())->willReturn(array());
        $matchers->find(Argument::cetera())->shouldBeCalled()->WillReturn($matcher);
        $matcher->positiveMatch(Argument::cetera())
            ->willThrow('PhpSpec\Exception\Example\FailureException');

        $dispatcher->dispatch(
            'beforeExpectation',
            Argument::type('PhpSpec\Event\ExpectationEvent')
        )->shouldBeCalled();

        $dispatcher->dispatch(
            'afterExpectation',
            Argument::which('getResult', ExpectationEvent::FAILED)
        )->shouldBeCalled();

        try {
            $this->callOnWrappedObject('should', array('beBoolean'));
        } catch (FailureException $e) {

        }
    }

    function it_dispatches_after_expectation_event_with_broken_status_if_throws_exception_for_should(
        MatcherManager $matchers, Unwrapper $unwrapper, EventDispatcherInterface $dispatcher,
        MatcherInterface $matcher)
    {
        $unwrapper->unwrapOne(Argument::any())->willReturn(null);
        $unwrapper->unwrapAll(Argument::any())->willReturn(array());
        $matchers->find(Argument::cetera())->shouldBeCalled()->WillReturn($matcher);
        $matcher->positiveMatch(Argument::cetera())
            ->willThrow('RuntimeException');

        $dispatcher->dispatch(
            'beforeExpectation',
            Argument::type('PhpSpec\Event\ExpectationEvent')
        )->shouldBeCalled();

        $dispatcher->dispatch(
            'afterExpectation',
            Argument::which('getResult', ExpectationEvent::BROKEN)
        )->shouldBeCalled();

        try {
            $this->callOnWrappedObject('should', array('beBoolean'));
        } catch (RuntimeException $e) {

        }
    }

    function it_dispatches_expectation_events_for_should_not(MatcherManager $matchers,
        Unwrapper $unwrapper, EventDispatcherInterface $dispatcher, MatcherInterface $matcher)
    {
        $unwrapper->unwrapOne(Argument::any())->willReturn(null);
        $unwrapper->unwrapAll(Argument::any())->willReturn(array());
        $matchers->find(Argument::cetera())->shouldBeCalled()->WillReturn($matcher);

        $dispatcher->dispatch(
            'beforeExpectation',
            Argument::type('PhpSpec\Event\ExpectationEvent')
        )->shouldBeCalled();

        $dispatcher->dispatch(
            'afterExpectation',
            Argument::which('getResult', ExpectationEvent::PASSED)
        )->shouldBeCalled();

        $this->callOnWrappedObject('shouldNot', array('beBoolean'));
    }

    function it_dispatches_after_expectation_event_with_failed_status_if_matcher_throws_exception_for_should_not(
        MatcherManager $matchers, Unwrapper $unwrapper, EventDispatcherInterface $dispatcher,
        MatcherInterface $matcher)
    {
        $unwrapper->unwrapOne(Argument::any())->willReturn(null);
        $unwrapper->unwrapAll(Argument::any())->willReturn(array());
        $matchers->find(Argument::cetera())->shouldBeCalled()->WillReturn($matcher);
        $matcher->negativeMatch(Argument::cetera())->willThrow('PhpSpec\Exception\Example\FailureException');

        $dispatcher->dispatch(
            'beforeExpectation',
            Argument::type('PhpSpec\Event\ExpectationEvent')
        )->shouldBeCalled();

        $dispatcher->dispatch(
            'afterExpectation',
            Argument::which('getResult', ExpectationEvent::FAILED)
        )->shouldBeCalled();

        try {
            $this->callOnWrappedObject('shouldNot', array('beBoolean'));
        } catch (FailureException $e) {

        }
    }

    function it_dispatches_after_expectation_event_with_broken_status_if_throws_exception_for_should_not(
        MatcherManager $matchers, Unwrapper $unwrapper, EventDispatcherInterface $dispatcher,
        MatcherInterface $matcher)
    {
        $unwrapper->unwrapOne(Argument::any())->willReturn(null);
        $unwrapper->unwrapAll(Argument::any())->willReturn(array());
        $matchers->find(Argument::cetera())->shouldBeCalled()->WillReturn($matcher);
        $matcher->negativeMatch(Argument::cetera())
            ->willThrow('RuntimeException');

        $dispatcher->dispatch(
            'beforeExpectation',
            Argument::type('PhpSpec\Event\ExpectationEvent')
        )->shouldBeCalled();

        $dispatcher->dispatch(
            'afterExpectation',
            Argument::which('getResult', ExpectationEvent::BROKEN)
        )->shouldBeCalled();

        try {
            $this->callOnWrappedObject('shouldNot', array('beBoolean'));
        } catch (RuntimeException $e) {

        }
    }

    function it_dispatches_method_call_events(EventDispatcherInterface $dispatcher, Unwrapper $unwrapper)
    {
        $unwrapper->unwrapOne(Argument::any())->willReturn(new \Exception);
        $unwrapper->unwrapAll(Argument::any())->willReturn(array());

{'fraction_non_alphanumeric': 0.13777745851591122, 'fraction_numerical': 0.0, 'mean_word_length': 3.6780913978494625, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 173, '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': '5814500', 'n_tokens_mistral': 3831, 'n_tokens_neox': 3770, 'n_words': 465}