Problem/Motivation

In FlagSimpleTest, the doUserDeletionTest() method tests the deletion of flags when a user is deleted. We are trying to get rid of FlagSimpleTest.

Proposed resolution

Create a new test class. This need not be user centric, but test the deletion of both user and their flags, and an entity and its flags. Remove deUserDeletionTest() from FlagSimpleTest.

Remaining tasks

Create patch.

User interface changes

None.

API changes

None.

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

socketwench created an issue. See original summary.

socketwench’s picture

Status: Active » Needs review
FileSize
6.27 KB

This simply moves the test from FlagSimpleTest to a new test class. It does not add node deletion or flag deletion tests.

martin107’s picture

Assigned: Unassigned » martin107

Needs Reroll ... I am working on this now.

martin107’s picture

Assigned: martin107 » Unassigned
FileSize
6.57 KB

Here we go.

socketwench’s picture

+++ b/src/Tests/FlagDeletionTest.php
@@ -0,0 +1,103 @@
\ No newline at end of file

Missing newline at the end of FlagDeletionTest.php. Other than that, it looks good so far. I'd like to add test cases for node deletion and then flag deletion too.

martin107’s picture

Status: Needs review » Needs work
martin107’s picture

Status: Needs work » Closed (duplicate)

makes sense to me.

socketwench’s picture

Status: Closed (duplicate) » Needs work
martin107’s picture

Sorry looks like I closed the wrong issue.

socketwench’s picture

Status: Needs work » Needs review
FileSize
5.13 KB

Now that I think about it, there's not much reason to make a separate test here. Much of what I had in mind is already covered by FlagCountsTest. Let's just add the user test to the counts test.

Status: Needs review » Needs work

The last submitted patch, 10: deleteTest_2702911.10.patch, failed testing.

socketwench’s picture

Added missing schema statement.

Berdir’s picture

Status: Needs work » Needs review
martin107’s picture

Conceptually it is good to see those test move into a kernel test , and FlagCountsTest is the obvious choice.

Practically speaking the patch looks good, all the relevant testing has been transferred cleanly.

I have only rerolled this patch - so plus one from me - I regard this as RTBC

I have only the smallest of polishes to make

FlagCountTest::testUserDeletion() has no annonation.

  • socketwench authored 9b39128 on 8.x-4.x
    Issue #2702911 by socketwench, martin107: Moved user deletion test from...
socketwench’s picture

Status: Needs review » Fixed

Thanks for the fixes, Martin!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.