/** @test */
 public function it_returns_all_decisions()
 {
     $dbDecisionRepository = new DbDecisionRepository();
     $this->assertCount(0, $dbDecisionRepository->all());
     $actualEvents = factory(Decision::class, 2)->create();
     $expectedDecisions = $dbDecisionRepository->all();
     $this->assertSame(2, $expectedDecisions->count());
     $this->assertSame(array_only($expectedDecisions->toArray(), $expectedDecisions[0]->getFillable()), array_only($actualEvents->toArray(), $expectedDecisions[0]->getFillable()));
 }
Exemple #2
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $dbCompanyRepository = new DbCompanyRepository();
     $dbEventRepository = new DbEventRepository();
     $dbDecisionRepository = new DbDecisionRepository();
     foreach ($dbCompanyRepository->all() as $event) {
         $files = factory(File::class, 2)->create();
         $dbCompanyRepository->assignFiles($event, $files);
     }
     foreach ($dbEventRepository->all() as $event) {
         $files = factory(File::class, 2)->create();
         $dbEventRepository->assignFiles($event, $files);
     }
     foreach ($dbDecisionRepository->all() as $decision) {
         $file = factory(File::class)->create();
         $dbDecisionRepository->assignFile($decision, $file);
     }
 }