Skip to content
Snippets Groups Projects
Unverified Commit 4a2e7552 authored by DaveD's avatar DaveD Committed by GitHub
Browse files

Merge pull request #21222 from colemanw/delRecent

Improve test for CRM_Utils_Recent
parents 653ceed7 20b017b2
Branches
Tags
No related merge requests found
......@@ -27,10 +27,7 @@ use Civi\Api4\Activity;
*/
class RecentItemsTest extends UnitTestCase {
/**
* This locks in a fix to ensure that if a user doesn't have permission to view the is_deleted field that doesn't hard fail if that field happens to be in an APIv4 call.
*/
public function testIsDeletedPermission(): void {
public function testAddDeleteActivity(): void {
$cid = $this->createLoggedInUser();
$aid = Activity::create(FALSE)
......@@ -41,6 +38,8 @@ class RecentItemsTest extends UnitTestCase {
$this->assertEquals(1, $this->getRecentItemCount(['type' => 'Activity', 'id' => $aid]));
$this->assertStringContainsString('Hello recent!', \CRM_Utils_Recent::get()[0]['title']);
Activity::delete(FALSE)->addWhere('id', '=', $aid)->execute();
$this->assertEquals(0, $this->getRecentItemCount(['type' => 'Activity', 'id' => $aid]));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment