public function postgresql(UnitTester $I) { $I->wantToTest("Model validation by using PostgreSQL as RDBMS"); /** @var \Phalcon\Di\FactoryDefault $di */ $di = Di::getDefault(); $connection = $di->getShared('db'); $di->remove('db'); $di->setShared('db', function () { return new Postgresql(['host' => TEST_DB_POSTGRESQL_HOST, 'username' => TEST_DB_POSTGRESQL_USER, 'password' => TEST_DB_POSTGRESQL_PASSWD, 'dbname' => TEST_DB_POSTGRESQL_NAME, 'port' => TEST_DB_POSTGRESQL_PORT]); }); $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); }