/**
  * Test onBeforeDeleteCategory.
  *
  * @param CategoryModel $category
  *
  * @covers ::onBeforeDeleteCategory
  * @covers ::fields
  * @dataProvider provideSaveCategoryEvents
  */
 public final function testOnBeforeDeleteCategory(CategoryModel $category)
 {
     AuditLogRecord::$db = $this->setMockDbConnection();
     $this->setMockAuditLogService();
     $this->setMockUserSessionService();
     $this->setMockFieldsService();
     $service = new AuditLog_CategoryService();
     $event = new Event($service, array('category' => $category));
     $service->onBeforeDeleteCategory($event);
     $this->assertArrayHasKey('id', $service->after);
 }
 /**
  * Test onBeforeDeleteUser.
  *
  * @param UserModel $user
  *
  * @covers ::onBeforeDeleteUser
  * @covers ::fields
  * @dataProvider provideSaveUserEvents
  */
 public final function testOnBeforeDeleteUser(UserModel $user)
 {
     AuditLogRecord::$db = $this->setMockDbConnection();
     $this->setMockAuditLogService();
     $this->setMockUserGroupsService();
     $this->setMockUserSessionService();
     $this->setMockFieldsService();
     $service = new AuditLog_UserService();
     $event = new Event($service, array('user' => $user));
     $service->onBeforeDeleteUser($event);
     $this->assertArrayHasKey('id', $service->after);
 }