<commit_before><?php

namespace Tale\Test;

use Tale\Cache;

abstract class FileCacheTestBase extends \PHPUnit_Framework_TestCase
{

    private $_cachePath;
    private $_cache;

    public function setUp()
    {

        $this->_cachePath = $this->getPath();
        $this->_cache = new Cache();
        $this->addGateway($this->_cache, 'poolName');
    }

    abstract public function getPath();
    abstract public function addGateway(Cache $cache, $name);

    public function testCloning()
    {

        $cache = clone $this->_cache;
        $this->assertNotSame($this->_cache->poolName->getPool(), $cache->poolName->getPool());
        $this->assertNotSame($this->_cache->poolName->getPool()->getAdapter(), $cache->poolName->getPool()->getAdapter());
        $this->assertNotSame($this->_cache->poolName->getPool()->getAdapter()->getFormat(), $cache->poolName->getPool()->getAdapter()->getFormat());
    }

    /**
     * @depends testCloning
     * @dataProvider cachableValueProvider
     */
    public function testStoringOfValues($index, $value)<commit_msg>HHVM test<commit_after><?php

namespace Tale\Test;

use Tale\Cache;

abstract class FileCacheTestBase extends \PHPUnit_Framework_TestCase
{

    private $_cachePath;
    private $_cache;

    public function setUp()
    {

        $this->_cachePath = $this->getPath();
        $this->_cache = new Cache();
        $this->addGateway($this->_cache, 'poolName');
    }

    abstract public function getPath();
    abstract public function addGateway(Cache $cache, $name);

    public function testCloning()
    {

        $cache = clone $this->_cache;
        $this->assertNotSame($this->_cache->poolName->getPool(), $cache->poolName->getPool());
        $this->assertEquals($this->_cache->poolName->getPool(), $cache->poolName->getPool());
        $this->assertNotSame($this->_cache->poolName->getPool()->getAdapter(), $cache->poolName->getPool()->getAdapter());
        $this->assertEquals($this->_cache->poolName->getPool()->getAdapter(), $cache->poolName->getPool()->getAdapter());
        $this->assertNotSame($this->_cache->poolName->getPool()->getAdapter()->getFormat(), $cache->poolName->getPool()->getAdapter()->getFormat());
        $this->assertEquals($this->_cache->poolName->getPool()->getAdapter()->getFormat(), $cache->poolName->getPool()->getAdapter()->getFormat());
    }

    /**
     * @depends testCloning
     * @dataProvider cachableValueProvider
     */
    public function testStoringOfValues($index, $value)
{'fraction_non_alphanumeric': 0.1765412329863891, 'fraction_numerical': 0.0, 'mean_word_length': 3.8618677042801557, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 87, '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': '5687485', 'n_tokens_mistral': 713, 'n_tokens_neox': 699, 'n_words': 114}