X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/1c43602f4bed60a84f47735ca8bc4a399018e013..refs/pull/3433/head:/tests/TestCase.php diff --git a/tests/TestCase.php b/tests/TestCase.php index 080515173..98e0dfbac 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -62,7 +62,7 @@ abstract class TestCase extends BaseTestCase * 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]; @@ -71,6 +71,10 @@ abstract class TestCase extends BaseTestCase $detailsToCheck['entity_id'] = $entity->id; } + if ($detail) { + $detailsToCheck['detail'] = $detail; + } + $this->assertDatabaseHas('activities', $detailsToCheck); } }