<commit_before><?php
/**
 * This file is part of the PPI Framework.
 *
 * @copyright  Copyright (c) 2011-2015 <NAME> <<EMAIL>>
 * @license    http://opensource.org/licenses/mit-license.php MIT
 *
 * @link       http://www.ppi.io
 */

namespace PPI\FrameworkTest\Router;

use PPI\Framework\Router\Router;
use Symfony\Component\HttpFoundation\Request;

/**
 * Class RouterTest.
 *
 * @author <NAME> <<EMAIL>>
 */
class RouterTest extends \PHPUnit_Framework_TestCase
{
    private $router = null;

    protected function setUp()
    {
        $requestContext = $this->getMock('Symfony\Component\Routing\RequestContext');
        $collection     = $this->getMock('Symfony\Component\Routing\RouteCollection');
        $options        = array();
        $logger         = null;

        $this->router   = new Router($requestContext, $collection, $options, $logger);
    }

    public function testSetOptionsWithSupportedOptions()
    {
        $this->router->setOptions([
            'cache_dir'     => './cache',
            'debug'         => true,
            'resource_type' => 'ResourceType',
        ]);
        $this->assertSame('./cache', $this->router->getOption('cache_dir'));
        $this->assertTrue($this->router->getOption('debug'));
        $this->assertSame('ResourceType', $this->router->getOption('resource_type'));
    }

    /**
     * @expectedException \InvalidArgumentException
     * @expectedExceptionMessage The Router does not support the following options: "option_foo", "option_bar"
     */
    public function testSetOptionsWithUnsupportedOptions()
    {
        $this->router->setOptions([
            'cache_dir'     => './cache',
            'option_foo'    => true,
            'option_bar'    => 'baz',
            'resource_type' => 'ResourceType',
        ]);
    }

    public function testSetOptionWithSupportedOption()
    {
        $this->router->setOption('cache_dir', './cache');
        $this->assertSame('./cache', $this->router->getOption('cache_dir'));
    }

    /**
     * @expectedException \InvalidArgumentException
     * @expectedExceptionMessage The Router does not support the "option_foo" option
     */
    public function testSetOptionWithUnsupportedOption()
    {<commit_msg>Revert to standard array syntax (replaces short syntax)<commit_after><?php
/**
 * This file is part of the PPI Framework.
 *
 * @copyright  Copyright (c) 2011-2015 <NAME> <<EMAIL>>
 * @license    http://opensource.org/licenses/mit-license.php MIT
 *
 * @link       http://www.ppi.io
 */

namespace PPI\FrameworkTest\Router;

use PPI\Framework\Router\Router;
use Symfony\Component\HttpFoundation\Request;

/**
 * Class RouterTest.
 *
 * @author <NAME> <<EMAIL>>
 */
class RouterTest extends \PHPUnit_Framework_TestCase
{
    private $router = null;

    protected function setUp()
    {
        $requestContext = $this->getMock('Symfony\Component\Routing\RequestContext');
        $collection     = $this->getMock('Symfony\Component\Routing\RouteCollection');
        $options        = array();
        $logger         = null;

        $this->router   = new Router($requestContext, $collection, $options, $logger);
    }

    public function testSetOptionsWithSupportedOptions()
    {
        $this->router->setOptions(array(
            'cache_dir'     => './cache',
            'debug'         => true,
            'resource_type' => 'ResourceType',
        ));
        $this->assertSame('./cache', $this->router->getOption('cache_dir'));
        $this->assertTrue($this->router->getOption('debug'));
        $this->assertSame('ResourceType', $this->router->getOption('resource_type'));
    }

    /**
     * @expectedException \InvalidArgumentException
     * @expectedExceptionMessage The Router does not support the following options: "option_foo", "option_bar"
     */
    public function testSetOptionsWithUnsupportedOptions()
    {
        $this->router->setOptions([
            'cache_dir'     => './cache',
            'option_foo'    => true,
            'option_bar'    => 'baz',
            'resource_type' => 'ResourceType',
        ]);
    }

    public function testSetOptionWithSupportedOption()
    {
        $this->router->setOption('cache_dir', './cache');
        $this->assertSame('./cache', $this->router->getOption('cache_dir'));
    }

    /**
     * @expectedException \InvalidArgumentException
     * @expectedExceptionMessage The Router does not support the "option_foo" option
     */
    public function testSetOptionWithUnsupportedOption()
    {
{'fraction_non_alphanumeric': 0.14517203107658158, 'fraction_numerical': 0.003551609322974473, 'mean_word_length': 2.7425249169435215, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 71, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4122923', 'n_tokens_mistral': 1272, 'n_tokens_neox': 1243, 'n_words': 239}