* Assert that an activity entry exists of the given key.
* Checks the activity belongs to the given entity if provided.
*/
- protected function assertActivityExists(string $type, Entity $entity = null)
+ protected function assertActivityExists(string $type, ?Entity $entity = null, string $detail = '')
{
$detailsToCheck = ['type' => $type];
$detailsToCheck['entity_id'] = $entity->id;
}
+ if ($detail) {
+ $detailsToCheck['detail'] = $detail;
+ }
+
$this->assertDatabaseHas('activities', $detailsToCheck);
}
}