public function testAddDuplicateRelation() { $article = new Article(); $article->addCloneableRelation('test'); $article->addCloneableRelation('test'); $this->assertEquals(['photos', 'authors', 'test'], $article->getCloneableRelations()); }
protected function seed() { Article::unguard(); $this->article = Article::create(['title' => 'Test']); Author::unguard(); $this->article->authors()->attach(Author::create(['name' => 'Steve'])); $this->disk->write('test.jpg', 'contents'); Photo::unguard(); $this->article->photos()->save(new Photo(['uid' => 1, 'image' => '/uploads/test.jpg', 'source' => true])); }