Ejemplo n.º 1
0
 public function deleteMeta()
 {
     $articles = factory(Article::class, 2)->create()->all();
     $this->addMetasToArticles($articles);
     foreach ($articles as $oneEntity) {
         $oneEntity->push();
     }
     $article = current($articles);
     $metaEntity = $article->metas->first();
     $metaCount = ArticleMeta::where('article_id', '=', $article->article_id)->count();
     $this->delete('/articles/' . $article->article_id . '/meta/' . $metaEntity->name);
     $updatedArticle = Article::find($article->article_id);
     $this->assertEquals($metaCount - 1, $updatedArticle->metas->count());
 }
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     DB::statement(sprintf('DROP TABLE %s CASCADE', \App\Models\ArticleMeta::getTableName()));
 }