<commit_before><?php
/**
 *
 */

namespace Mvc5\Test\Route\Config;

use Mvc5\Arg;
use Mvc5\Route\Config as Route;
use Mvc5\Test\Test\TestCase;

class RouteTest
    extends TestCase
{
    /**
     *
     */
    function test_add()
    {
        $route = new Route;

        $route->add('bar', 'baz');

        $this->assertEquals('baz', $route->child('bar'));
    }

    /**
     *
     */
    function test_child_exists()
    {
        $route = new Route([Arg::CHILDREN => ['bar' => ['name' => 'baz']]]);

        $this->assertEquals(['name' => 'baz'], $route->child('bar'));
    }

    /**
     *
     */
    function test_child_not_exists()
    {
        $route = new Route;

        $this->assertEquals(null, $route->child('bar'));
    }

    /**
     *
     */
    function test_children_isset()
    {
        $route = new Route([Arg::CHILDREN => ['foo' => 'bar']]);

        $this->assertEquals(['foo' => 'bar'], $route->children());
    }

    /**
     *
     */
    function test_children_not_isset()
    {
        $route = new Route;

        $this->assertEquals([], $route->children());
    }

    /**
     *
     */
    function test_className()
    {
        $route = new Route([Arg::CLASS_NAME => 'foo']);

        $this->assertEquals('foo', $route->className());
    }

    /**
     *
     */
    function test_constraints_exists()
    {
        $route = new Route([Arg::CONSTRAINTS => ['foo' => 'bar']]);

        $this->assertEquals(['foo' => 'bar'], $route->constraints());
    }

    /**
     *
     */
    function test_constraints_not_exists()
    {
        $route = new Route;

        $this->assertEquals([], $route->constraints());
    }

    /**
     *
     */
    function test_controller()
    {
        $route = new Route([Arg::CONTROLLER => 'foo']);

        $this->assertEquals('foo', $route->controller());
    }

    /**
     *
     */
    function test_defaults_exists()
    {
        $route = new Route(['defaults' => ['foo' => 'bar']]);

        $this->assertEquals(['foo' => 'bar'], $route->defaults());
    }

    /**
     *
     */
    function test_defaults_not_exists()
    {
        $route = new Route;

        $this->assertEquals([], $route->defaults());
    }

    /**
     *
     */
    function test_host_exists()
    {
        $route = new Route(['host' => 'foo']);

        $this->assertEquals('foo', $route->host());
    }

    /**
     *
     */
    function test_host_not_exists()
    {
        $route = new Route;

        $this->assertEquals(null, $route->host());
    }

    /**
     *
     */
    function test_map_exists()
    {
        $route = new Route([Arg::MAP => ['foo' => 'bar']]);

        $this->assertEquals(['foo' => 'bar'], $route->map());
    }

    /**
     *
     */
    function test_map_not_exists()
    {
        $route = new Route;

        $this->assertEquals([], $route->map());
    }

    /**
     *
     */
    function test_method_exists()
    {
        $route = new Route([Arg::METHOD => 'foo']);

        $this->assertEquals('foo', $route->method());
    }

    /**
     *
     */
    function test_method_not_exists()
    {
        $route = new Route;

        $this->assertEquals(null, $route->method());
    }

    /**
     *
     */
    function test_name()
    {
        $route = new Route([Arg::NAME => 'foo']);

        $this->assertEquals('foo', $route->name());
    }

    /**
     *
     */
    function test_options_exists()
    {
        $route = new Route([Arg::OPTIONS => ['foo']]);

        $this->assertEquals(['foo'], $route->options());
    }

    /**
     *
     */
    function test_options_not_exists()
    {
        $route = new Route;

        $this->assertEquals([], $route->options());
    }

    /**
     *
     */
    function test_port_exists()
    {
        $route = new Route([Arg::PORT => '80']);

        $this->assertEquals('80', $route->port());
    }

    /**
     *
     */
    function test_port_not_exists()
    {
        $route = new Route;

        $this->assertEquals(null, $route->port());
    }

    /**
     *
     */
    function test_regex()
    {
        $route = new Route([Arg::REGEX => 'foo']);

        $this->assertEquals('foo', $route->regex());
    }

    /**
     *<commit_msg>remove added options and keep bc<commit_after><?php
/**
 *
 */

namespace Mvc5\Test\Route\Config;

use Mvc5\Arg;
use Mvc5\Route\Config as Route;
use Mvc5\Test\Test\TestCase;

class RouteTest
    extends TestCase
{
    /**
     *
     */
    function test_add()
    {
        $route = new Route;

        $route->add('bar', 'baz');

        $this->assertEquals('baz', $route->child('bar'));
    }

    /**
     *
     */
    function test_child_exists()
    {
        $route = new Route([Arg::CHILDREN => ['bar' => ['name' => 'baz']]]);

        $this->assertEquals(['name' => 'baz'], $route->child('bar'));
    }

    /**
     *
     */
    function test_child_not_exists()
    {
        $route = new Route;

        $this->assertEquals(null, $route->child('bar'));
    }

    /**
     *
     */
    function test_children_isset()
    {
        $route = new Route([Arg::CHILDREN => ['foo' => 'bar']]);

        $this->assertEquals(['foo' => 'bar'], $route->children());
    }

    /**
     *
     */
    function test_children_not_isset()
    {
        $route = new Route;

        $this->assertEquals([], $route->children());
    }

    /**
     *
     */
    function test_className()
    {
        $route = new Route([Arg::CLASS_NAME => 'foo']);

        $this->assertEquals('foo', $route->className());
    }

    /**
     *
     */
    function test_constraints_exists()
    {
        $route = new Route([Arg::CONSTRAINTS => ['foo' => 'bar']]);

        $this->assertEquals(['foo' => 'bar'], $route->constraints());
    }

    /**
     *
     */
    function test_constraints_not_exists()
    {
        $route = new Route;

        $this->assertEquals([], $route->constraints());
    }

    /**
     *
     */
    function test_controller()
    {
        $route = new Route([Arg::CONTROLLER => 'foo']);

        $this->assertEquals('foo', $route->controller());
    }

    /**
     *
     */
    function test_defaults_exists()
    {
        $route = new Route(['defaults' => ['foo' => 'bar']]);

        $this->assertEquals(['foo' => 'bar'], $route->defaults());
    }

    /**
     *
     */
    function test_defaults_not_exists()
    {
        $route = new Route;

        $this->assertEquals([], $route->defaults());
    }

    /**
     *
     */
    function test_host_exists()
    {
        $route = new Route(['host' => 'foo']);

        $this->assertEquals('foo', $route->host());
    }

    /**
     *
     */
    function test_host_not_exists()
    {
        $route = new Route;

        $this->assertEquals(null, $route->host());
    }

    /**
     *
     */
    function test_map_exists()
    {
        $route = new Route([Arg::MAP => ['foo' => 'bar']]);

        $this->assertEquals(['foo' => 'bar'], $route->map());
    }

    /**
     *
     */
    function test_map_not_exists()
    {
        $route = new Route;

        $this->assertEquals([], $route->map());
    }

    /**
     *
     */
    function test_method_exists()
    {
        $route = new Route([Arg::METHOD => 'foo']);

        $this->assertEquals('foo', $route->method());
    }

    /**
     *
     */
    function test_method_not_exists()
    {
        $route = new Route;

        $this->assertEquals(null, $route->method());
    }

    /**
     *
     */
    function test_name()
    {
        $route = new Route([Arg::NAME => 'foo']);

        $this->assertEquals('foo', $route->name());
    }

    /**
     *
     */
    function test_port_exists()
    {
        $route = new Route([Arg::PORT => '80']);

        $this->assertEquals('80', $route->port());
    }

    /**
     *
     */
    function test_port_not_exists()
    {
        $route = new Route;

        $this->assertEquals(null, $route->port());
    }

    /**
     *
     */
    function test_regex()
    {
        $route = new Route([Arg::REGEX => 'foo']);

        $this->assertEquals('foo', $route->regex());
    }

    /**
     *
{'fraction_non_alphanumeric': 0.20362828582006665, 'fraction_numerical': 0.0019745773170430705, 'mean_word_length': 1.7867950481430537, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 140, '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': '753125', 'n_tokens_mistral': 2644, 'n_tokens_neox': 2543, 'n_words': 394}