Phalcon\Test\Unit\Mvc\Model\ValidationCest::mysql PHP Method

mysql() public method

public mysql ( UnitTester $I )
$I UnitTester
    public function mysql(UnitTester $I)
    {
        $I->wantToTest("Model validation by using MySQL as RDBMS");
        /** @var \Phalcon\Di\FactoryDefault $di */
        $di = Di::getDefault();
        $connection = $di->getShared('db');
        $di->remove('db');
        $di->setShared('db', function () {
            return new Mysql(['host' => TEST_DB_MYSQL_HOST, 'username' => TEST_DB_MYSQL_USER, 'password' => TEST_DB_MYSQL_PASSWD, 'dbname' => TEST_DB_MYSQL_NAME, 'port' => TEST_DB_MYSQL_PORT, 'charset' => TEST_DB_MYSQL_CHARSET]);
        });
        Di::setDefault($di);
        $this->success($I);
        $this->presenceOf($I);
        $this->email($I);
        $this->emailWithDot($I);
        $this->exclusionIn($I);
        $this->inclusionIn($I);
        $this->uniqueness1($I);
        $this->uniqueness2($I);
        $this->regex($I);
        $this->tooLong($I);
        $this->tooShort($I);
        $di->remove('db');
        $di->setShared('db', $connection);
    }