<commit_before><?php

namespace Blockade\Tests\EventListener;

use Blockade\EventListener\FirewallListener;

use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpFoundation\Request;

require_once __DIR__ . '/../../../bootstrap.php';

/**
 * FirewallListenerTest
 *
 * @author <NAME> <<EMAIL>>
 **/
class FirewallListenerTest extends \PHPUnit_Framework_TestCase
{

    protected $firewall;

    public function setUp()
    {
        $this->listener = new FirewallListener();
    }

    protected function newFirewall()
    {
        return $this->getMockBuilder('Blockade\Firewall')
                    ->disableOriginalConstructor()
                    ->getMock();
    }

    public function testAddFirewall()
    {
        $this->assertSame(array(), $this->listener->getFirewalls());
        $firewall = $this->newFirewall();
        $this->listener->addFirewall($firewall);
        $this->assertSame(array($firewall), $this->listener->getFirewalls());
        $this->listener->addFirewall($firewall);
        $this->assertSame(array($firewall, $firewall), $this->listener->getFirewalls());
    }

    public function testPushFirewall()<commit_msg>Fixing incorrectly named variable.<commit_after><?php

namespace Blockade\Tests\EventListener;

use Blockade\EventListener\FirewallListener;

use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpFoundation\Request;

require_once __DIR__ . '/../../../bootstrap.php';

/**
 * FirewallListenerTest
 *
 * @author <NAME> <<EMAIL>>
 **/
class FirewallListenerTest extends \PHPUnit_Framework_TestCase
{

    protected $listener;

    public function setUp()
    {
        $this->listener = new FirewallListener();
    }

    protected function newFirewall()
    {
        return $this->getMockBuilder('Blockade\Firewall')
                    ->disableOriginalConstructor()
                    ->getMock();
    }

    public function testAddFirewall()
    {
        $this->assertSame(array(), $this->listener->getFirewalls());
        $firewall = $this->newFirewall();
        $this->listener->addFirewall($firewall);
        $this->assertSame(array($firewall), $this->listener->getFirewalls());
        $this->listener->addFirewall($firewall);
        $this->assertSame(array($firewall, $firewall), $this->listener->getFirewalls());
    }

    public function testPushFirewall()
{'fraction_non_alphanumeric': 0.14181818181818182, 'fraction_numerical': 0.0, 'mean_word_length': 3.413547237076649, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 45, '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': '4738319', 'n_tokens_mistral': 699, 'n_tokens_neox': 679, 'n_words': 110}