Phalcon\Test\Mvc\Model\Behavior\Helper::_before PHP Method

_before() protected method

executed before each test
protected _before ( )
    protected function _before()
    {
        require_once 'Stubs/Categories.php';
        $this->previousDependencyInjector = Di::getDefault();
        $di = new Di();
        $di->setShared('modelsMetadata', new Metadata\Memory());
        $di->setShared('modelsManager', new Manager());
        $di->setShared('db', function () {
            return new Mysql(['host' => TEST_DB_HOST, 'port' => TEST_DB_PORT, 'username' => TEST_DB_USER, 'password' => TEST_DB_PASSWD, 'dbname' => TEST_DB_NAME, 'charset' => TEST_DB_CHARSET]);
        });
        if ($this->previousDependencyInjector instanceof DiInterface) {
            Di::setDefault($di);
        }
        $this->truncateTable(CategoriesManyRoots::$table);
    }