<commit_before><?php

/**
 * This file is part of expectation package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace Preview\DSL\BDD;

use Assert\Assertion;
use expectation\spec\fixture\FixtureExpectation;
use expectation\ConfigrationBuilder;
use stdClass;

describe('Configurable', function() {

    describe('configure', function() {
        context('when with configurator', function() {
            before(function() {
                $this->subject = $subject = new stdClass();
                $this->subject->callCount = 0;
                $this->subject->callArgument = null;

                FixtureExpectation::configure(function(ConfigrationBuilder $config) use($subject) {
                    $subject->callCount++;
                    $subject->callArgument = $config;

                    $config->registerMatcherNamespace('expectation\spec\fixture', __DIR__ . '/fixture');
                });
            });
            it('should create configration', function() {
                Assertion::isInstanceOf(FixtureExpectation::configration(), 'expectation\Configration');
            });
/*
            it('should configurator call once', function() {
                Assertion::same($this->subject->callCount, 1);
            });
*/
        });
        context('when configurator empty', function() {
            before(function() {
                FixtureExpectation::configure();
            });
            it('should create configration', function() {
                Assertion::isInstanceOf(FixtureExpectation::configration(), 'expectation\Configration');<commit_msg>add call count spec<commit_after><?php

/**
 * This file is part of expectation package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace Preview\DSL\BDD;

use Assert\Assertion;
use expectation\spec\fixture\FixtureExpectation;
use expectation\ConfigrationBuilder;
use stdClass;

describe('Configurable', function() {

    describe('configure', function() {
        context('when with configurator', function() {

            $subject = new stdClass();
            $subject->callCount = 0;

            FixtureExpectation::configure(function(ConfigrationBuilder $config) use($subject) {
                $subject->callCount++;

                $config->registerMatcherNamespace('expectation\spec\fixture', __DIR__ . '/fixture');
            });
            it('should configurator call once', function() use($subject) {
                Assertion::same($subject->callCount, 1);
            });
            it('should create configration', function() {
                Assertion::isInstanceOf(FixtureExpectation::configration(), 'expectation\Configration');
            });
        });
        context('when configurator empty', function() {
            before(function() {
                FixtureExpectation::configure();
            });
            it('should create configration', function() {
                Assertion::isInstanceOf(FixtureExpectation::configration(), 'expectation\Configration');
{'fraction_non_alphanumeric': 0.12769278801123946, 'fraction_numerical': 0.001248829222603809, 'mean_word_length': 2.5093099671412924, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 23, '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': '741424', 'n_tokens_mistral': 827, 'n_tokens_neox': 779, 'n_words': 181}