/**
  * @test
  * it should scaffold new blog tables
  */
 public function it_should_scaffold_new_blog_tables(FunctionalTester $I)
 {
     $I->haveMultisiteInDatabase();
     $id = $I->haveBlogInDatabase('test');
     $I->useBlog($id);
     foreach (Tables::newBlogTables() as $table) {
         $I->seeTableInDatabase($I->grabPrefixedTableNameFor($table));
     }
 }
Beispiel #2
0
 private function scaffoldBlogTables($blogId, $subdomain = null)
 {
     $stylesheet = $this->grabOptionFromDatabase('stylesheet');
     $data = ['subdomain' => $subdomain, 'domain' => $this->getSiteDomain(), 'subfolder' => $this->getSiteSubfolder(), 'stylesheet' => $stylesheet];
     $dbh = $this->driver->getDbh();
     $dropQuery = $this->tables->getBlogDropQuery($this->config['tablePrefix'], $blogId);
     $sth = $dbh->prepare($dropQuery);
     $this->debugSection('Query', $sth->queryString);
     $sth->execute();
     $scaffoldQuery = $this->tables->getBlogScaffoldQuery($this->config['tablePrefix'], $blogId, $data);
     $sth = $dbh->prepare($scaffoldQuery);
     $this->debugSection('Query', $sth->queryString);
     $sth->execute();
     $this->scaffoldedBlogIds[] = $blogId;
 }