<commit_before><?php
use Aedart\Scaffold\Cache\CacheHelper;
use Aedart\Scaffold\Containers\IoC;
use Aedart\Scaffold\Providers\CacheServiceProvider;
use Aedart\Scaffold\Providers\ConfigServiceProvider;
use Aedart\Scaffold\Providers\FilesystemServiceProvider;
use Illuminate\Contracts\Cache\Repository;

/**
 * CacheTest
 *
 * @group cache
 *
 * @author <NAME> <<EMAIL>>
 */
class CacheTest extends BaseUnitTest
{

    protected function _before()
    {
        parent::_before();

        $ioc = IoC::getInstance();
        $ioc->registerServiceProviders([
            FilesystemServiceProvider::class,
            ConfigServiceProvider::class,
            CacheServiceProvider::class
        ]);

        CacheHelper::setCacheDirectory($this->outputPath());
    }

    protected function _after()
    {
        //$this->emptyPath($this->outputPath());

        parent::_after();
    }

    public function outputPath()
    {
        return parent::outputPath() . 'cache/';
    }

    /**
     * Returns instance of a cache repository
     *
     * @return Repository
     */
    public function makeCache()
    {
        return CacheHelper::make();
    }

    /******************************************************************
     * Actual tests
     *****************************************************************/

    /**<commit_msg>Fix test cleanup<commit_after><?php
use Aedart\Scaffold\Cache\CacheHelper;
use Aedart\Scaffold\Containers\IoC;
use Aedart\Scaffold\Providers\CacheServiceProvider;
use Aedart\Scaffold\Providers\ConfigServiceProvider;
use Aedart\Scaffold\Providers\FilesystemServiceProvider;
use Illuminate\Contracts\Cache\Repository;

/**
 * CacheTest
 *
 * @group cache
 *
 * @author <NAME> <<EMAIL>>
 */
class CacheTest extends BaseUnitTest
{

    protected function _before()
    {
        parent::_before();

        $ioc = IoC::getInstance();
        $ioc->registerServiceProviders([
            FilesystemServiceProvider::class,
            ConfigServiceProvider::class,
            CacheServiceProvider::class
        ]);

        CacheHelper::setCacheDirectory($this->outputPath());
    }

    protected function _after()
    {
        $this->emptyPath($this->outputPath());

        parent::_after();
    }

    public function outputPath()
    {
        return parent::outputPath() . 'cache/';
    }

    /**
     * Returns instance of a cache repository
     *
     * @return Repository
     */
    public function makeCache()
    {
        return CacheHelper::make();
    }

    /******************************************************************
     * Actual tests
     *****************************************************************/

    /**
{'fraction_non_alphanumeric': 0.2081312942931742, 'fraction_numerical': 0.0, 'mean_word_length': 3.008968609865471, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, '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': '5192548', 'n_tokens_mistral': 722, 'n_tokens_neox': 705, 'n_words': 122}