public function testDrop()
 {
     list($member, $auth, $repo, $cfg) = $this->getMocks();
     $instance = new CommentHandler($member, $auth, $repo, $cfg);
     $repo->shouldReceive('dropInstance')->once()->with('instanceId');
     $cfg->shouldReceive('removeByName')->once();
     $instance->drop('instanceId');
 }
Esempio n. 2
0
 /**
  * 게시판 제거
  *
  * @param string $boardId board id
  * @return void
  */
 public function destroy($boardId)
 {
     $config = $this->configHandler->get($boardId);
     if ($config === null) {
         throw new Exceptions\InvalidConfigException();
     }
     $this->conn->beginTransaction();
     // get document config
     $this->document->destroyInstance($boardId);
     $this->comment->drop($boardId);
     // remove board config
     $this->configHandler->remove($config);
     // 연결된 df 제거
     foreach ($this->configHandler->getDynamicFields($config) as $config) {
         $this->dynamicField->drop($config);
     }
     $this->conn->commit();
 }