<commit_before><?php
/**
 * @author <NAME> <EMAIL>
 * @copyright (c) <NAME> 2013
 * @license http://opensource.org/licenses/mit-license.php
 */

namespace StrokerCacheTest\Strategy;

use StrokerCache\Strategy\ControllerName;

class ControllerNameTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var ControllerName
     */
    private $strategy;

    /**
     * Setup
     */
    public function setUp()
    {
        $this->strategy = new ControllerName();
    }

    /**
     * @return array
     */
    public static function shouldCacheProvider()
    {
        return array(
            array(array('Namespace\TestController'), 'Namespace\TestController', true),
            array(array(), 'Namespace\TestController', false),
            array(array('Namespace\TestController2'), 'Namespace\TestController', false),
        );
    }

    /**
     * @param array $controllers
     * @param string $requestedController
     * @param boolean $expectedResult
     * @dataProvider shouldCacheProvider
     */
    public function testShouldCache($controllers, $requestedController, $expectedResult)
    {
        $this->strategy->setControllers($controllers);
        $mvcEvent = new \Zend\Mvc\MvcEvent();
        $mvcEvent->setControllerClass($requestedController);
        $this->assertEquals($expectedResult, $this->strategy->shouldCache($mvcEvent));
    }
}
<commit_msg>fixed test for controller name strategy<commit_after><?php
/**
 * @author <NAME> <EMAIL>
 * @copyright (c) <NAME> 2013
 * @license http://opensource.org/licenses/mit-license.php
 */

namespace StrokerCacheTest\Strategy;

use StrokerCache\Strategy\ControllerName;
use Zend\Mvc\Router\RouteMatch;

class ControllerNameTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var ControllerName
     */
    private $strategy;

    /**
     * Setup
     */
    public function setUp()
    {
        $this->strategy = new ControllerName();
    }

    /**
     * @return array
     */
    public static function shouldCacheProvider()
    {
        return array(
            array(array('Namespace\TestController'), 'Namespace\TestController', true),
            array(array(), 'Namespace\TestController', false),
            array(array('Namespace\TestController2'), 'Namespace\TestController', false),
        );
    }

    /**
     * @param array $controllers
     * @param string $requestedController
     * @param boolean $expectedResult
     * @dataProvider shouldCacheProvider
     */
    public function testShouldCache($controllers, $requestedController, $expectedResult)
    {
        $this->strategy->setControllers($controllers);
        $mvcEvent = new \Zend\Mvc\MvcEvent();
        $mvcEvent->setControllerClass($requestedController);
        $mvcEvent->setRouteMatch(new RouteMatch(array('controller' => $requestedController)));
        $this->assertEquals($expectedResult, $this->strategy->shouldCache($mvcEvent));
    }
}

{'fraction_non_alphanumeric': 0.1307032590051458, 'fraction_numerical': 0.003430531732418525, 'mean_word_length': 3.038781163434903, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 25, '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': '1787241', 'n_tokens_mistral': 813, 'n_tokens_neox': 802, 'n_words': 148}