Skip to content
This repository has been archived by the owner on Apr 13, 2022. It is now read-only.

Commit

Permalink
Enforce the model serialization trait only if there are params
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Jul 23, 2016
1 parent 4eb081f commit da5b245
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/JobTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,14 @@ trait JobTrait

public function testJobSerializesModels()
{
$rc = new ReflectionClass($this->getObjectAndParams()['object']);
$data = $this->getObjectAndParams();

$this->assertTrue(in_array(SerializesModels::class, $rc->getTraitNames(), true));
$rc = new ReflectionClass($data['object']);

if ($data['params']) {
$this->assertTrue(in_array(SerializesModels::class, $rc->getTraitNames(), true));
} else {
$this->assertFalse(in_array(SerializesModels::class, $rc->getTraitNames(), true));
}
}
}

0 comments on commit da5b245

Please sign in to comment.