예제 #1
0
    protected function setUp()
    {
        parent::setUp();
        try {
            $this->pdo->prepare('DROP TABLE posts')->execute();
        } catch (\PDOException $e) {
        }
        $create = <<<SQL
CREATE TABLE posts (
  id INT NOT NULL,
  status VARCHAR(32) NOT NULL,
  PRIMARY KEY(id)
)
SQL;
        $this->pdo->prepare($create)->execute();
        for ($i = 1; $i <= 10; $i++) {
            $status = 0 === $i % 2 ? 'even' : 'odd';
            $sth = $this->getPdoStatement('INSERT INTO posts (id, status) VALUES (' . $i . ', "' . $status . '")');
            $sth->execute();
        }
    }
예제 #2
0
 protected function setUp()
 {
     parent::setUp();
     $this->databaseProvider = $this->getDatabaseProvider();
     $this->databaseProvider->setAclSchema($this->aclSchema);
 }