asEditor(); $page = $this->entities->page(); Activity::add(ActivityType::PAGE_UPDATE, $page); $this->assertDatabaseHas('activities', [ 'type' => 'page_update', 'loggable_id' => $page->id, 'user_id' => $this->users->editor()->id, ]); DB::rollBack(); $exitCode = Artisan::call('bookstack:clear-activity'); DB::beginTransaction(); $this->assertTrue($exitCode === 0, 'Command executed successfully'); $this->assertDatabaseMissing('activities', [ 'type' => 'page_update', ]); } }