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

namespace Mvc5\Test\Resolver\Resolver;

use Mvc5\Config;
use Mvc5\Container;
use Mvc5\Plugin\Plugin;
use Mvc5\Test\Resolver\Resolver;
use Mvc5\Test\Test\TestCase;

class PluginTest
    extends TestCase
{
    /**
     *
     */
    function test_plugin_false()
    {
        $resolver = new Resolver;

        $this->assertEquals(false, $resolver->plugin(false));
    }

    /**
     *
     */
    function test_plugin_string_build()
    {
        $resolver = new Resolver;

        $resolver->configure('foo', new Container(['bar' => Config::class]));

        $this->assertEquals(new Config, $resolver->plugin('foo->bar'));
    }

    /**
     *
     */
    function test_plugin_array_without_named_args()
    {
        $resolver = new Resolver;

        $resolver->configure('exception\model', ['layout', 'error/exception']);
        $resolver->configure('layout',          ['Mvc5\Layout', 'layout']);

        $model = $resolver->plugin('exception\model');

        $this->assertEquals('error/exception', $model->template());
    }

    /**
     *
     */
    function test_plugin_array_with_named_args()
    {
        $resolver = new Resolver;

        $resolver->configure('exception\model', ['layout', 'template' => 'error/exception']);
        $resolver->configure('layout',          ['Mvc5\Layout', 'template' => 'layout']);

        $model = $resolver->plugin('exception\model');

        $this->assertEquals('error/exception', $model->template());
    }

    /**
     *
     */
    function test_plugin_closure_with_scope()
    {
        $resolver = new Resolver;<commit_msg>rename error and exception templates<commit_after><?php
/**
 *
 */

namespace Mvc5\Test\Resolver\Resolver;

use Mvc5\Config;
use Mvc5\Container;
use Mvc5\Plugin\Plugin;
use Mvc5\Test\Resolver\Resolver;
use Mvc5\Test\Test\TestCase;

class PluginTest
    extends TestCase
{
    /**
     *
     */
    function test_plugin_false()
    {
        $resolver = new Resolver;

        $this->assertEquals(false, $resolver->plugin(false));
    }

    /**
     *
     */
    function test_plugin_string_build()
    {
        $resolver = new Resolver;

        $resolver->configure('foo', new Container(['bar' => Config::class]));

        $this->assertEquals(new Config, $resolver->plugin('foo->bar'));
    }

    /**
     *
     */
    function test_plugin_array_without_named_args()
    {
        $resolver = new Resolver;

        $resolver->configure('exception\model', ['layout', 'exception']);
        $resolver->configure('layout',          ['Mvc5\Layout', 'layout']);

        $model = $resolver->plugin('exception\model');

        $this->assertEquals('exception', $model->template());
    }

    /**
     *
     */
    function test_plugin_array_with_named_args()
    {
        $resolver = new Resolver;

        $resolver->configure('exception\model', ['layout', 'template' => 'exception']);
        $resolver->configure('layout',          ['Mvc5\Layout', 'template' => 'layout']);

        $model = $resolver->plugin('exception\model');

        $this->assertEquals('exception', $model->template());
    }

    /**
     *
     */
    function test_plugin_closure_with_scope()
    {
        $resolver = new Resolver;
{'fraction_non_alphanumeric': 0.16692426584234932, 'fraction_numerical': 0.004945904173106646, 'mean_word_length': 2.5521405049396266, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 41, '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': '6629447', 'n_tokens_mistral': 991, 'n_tokens_neox': 970, 'n_words': 149}