コード例 #1
0
ファイル: CloneableTest.php プロジェクト: bkwld/cloner
 public function testAddDuplicateRelation()
 {
     $article = new Article();
     $article->addCloneableRelation('test');
     $article->addCloneableRelation('test');
     $this->assertEquals(['photos', 'authors', 'test'], $article->getCloneableRelations());
 }
コード例 #2
0
ファイル: FunctionalTest.php プロジェクト: bkwld/cloner
 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]));
 }