<commit_before><?php
namespace FlowerTest\View\Pane\Service;

use Flower\Test\TestTool;
use Flower\View\Pane\PaneClass\Pane;
use Flower\View\Pane\PaneEvent;
use Flower\View\Pane\Service\CacheListener;
use Zend\EventManager\EventManager;

/**
 * Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2014-02-07 at 11:03:24.
 */
class CacheListenerConcreteTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var CacheListener
     */
    protected $object;

    protected $config;

    protected $storageOptions;

    /**
     * Sets up the fixture, for example, opens a network connection.
     * This method is called before a test is executed.
     */
    protected function setUp()
    {
        $this->object = new CacheListener;
        $this->config = require 'TestAsset/cache_listener.config.php';
        $this->storageOptions = $this->config['test_pane_cache']['cache_storage'];
    }

    /**
     * Tears down the fixture, for example, closes a network connection.
     * This method is called after a test is executed.
     */
    protected function tearDown()
    {
    }

    public function testPostGetConcreteCache()
    {
        $paneId = 'foo';
        $pane = new Pane;
        $event = new PaneEvent(PaneEvent::EVENT_GET_PANE);
        $event->setPaneId($paneId);
        $event->setTarget($pane);

        $this->object->setStorageOptions($this->storageOptions);
        $res = $this->object->postGet($event);
        $this->assertSame($pane, $res);
    }

    public function testPreGetConcreteCache()
    {
        $paneId = 'preset';
        $event = new PaneEvent(PaneEvent::EVENT_GET_PANE);
        $event->setPaneId($paneId);
        $event->setTarget($paneId);

        $this->object->setStorageOptions($this->storageOptions);
        $res = $this->object->preGet($event);
        $this->assertSame(null, $res);
    }
}<commit_msg>Add private tearDown<commit_after><?php
namespace FlowerTest\View\Pane\Service;

use Flower\Test\TestTool;
use Flower\View\Pane\PaneClass\Pane;
use Flower\View\Pane\PaneEvent;
use Flower\View\Pane\Service\CacheListener;
use Zend\EventManager\EventManager;

/**
 * Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2014-02-07 at 11:03:24.
 */
class CacheListenerConcreteTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var CacheListener
     */
    protected $object;

    protected $config;

    protected $storageOptions;

    /**
     * Sets up the fixture, for example, opens a network connection.
     * This method is called before a test is executed.
     */
    protected function setUp()
    {
        $this->object = new CacheListener;
        $this->config = require 'TestAsset/cache_listener.config.php';
        $this->storageOptions = $this->config['test_pane_cache']['cache_storage'];
    }

    /**
     * Tears down the fixture, for example, closes a network connection.
     * This method is called after a test is executed.
     */
    protected function tearDown()
    {
    }

    public function testPostGetConcreteCache()
    {
        $paneId = 'foo';
        $pane = new Pane;
        $event = new PaneEvent(PaneEvent::EVENT_GET_PANE);
        $event->setPaneId($paneId);
        $event->setTarget($pane);

        $this->object->setStorageOptions($this->storageOptions);
        $res = $this->object->postGet($event);
        $this->assertSame($pane, $res);

        $storage = $this->object->getStorage();
        $storage->removeItem('foo');
    }

    public function testPreGetConcreteCache()
    {
        $paneId = 'preset';
        $event = new PaneEvent(PaneEvent::EVENT_GET_PANE);
        $event->setPaneId($paneId);
        $event->setTarget($paneId);

        $this->object->setStorageOptions($this->storageOptions);
        $res = $this->object->preGet($event);
        $this->assertInstanceOf('Flower\View\Pane\PaneClass\Pane', $res);
    }
}
{'fraction_non_alphanumeric': 0.13253638253638253, 'fraction_numerical': 0.008835758835758836, 'mean_word_length': 2.8996960486322187, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 46, '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': '6614293', 'n_tokens_mistral': 1211, 'n_tokens_neox': 1160, 'n_words': 241}