// Switch to a global flag, the accounting rules.
    $this->flag->setGlobal(TRUE);

We don't support changing the scope of a flag, so the test should not do this either.

This probably makes the test meaningless at the moment, as the test first flags a node by two different users, then changes the flag to global. A global flag would never have the same node flagged by two users!

Issue fork flag-2870574

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

joachim created an issue. See original summary.

joachim’s picture

I'm not actually sure what this part of the test is testing, so I've filed #2870697: getUserFlagFlaggingCount() should document its behaviour with global flags.


    // Switch to a global flag, the accounting rules.
    $this->flag->setGlobal(TRUE);
    $this->flag->save();

    // Despite being a global flag, queries about specific anonymous users can still be made.
    $rejected_count = $this->flagCountService->getUserFlagFlaggingCount($this->flag, $this->anonymousUser, $anon1_session_id);
    $this->assertEqual($rejected_count, 1, "getUserFlagFlaggingCount() ignores the session id.");
c.nish2k3’s picture

We should remove the test for getUserFlagFlaggingCount() on a global count as it does not make sense.

joachim’s picture

Issue tags: +beta blocker

Beta blocker, because we need rid of this in the tests to be able to remove the setGlobal() method.

ivnish’s picture

Issue tags: -beta blocker

Needs check

deaom made their first commit to this issue’s fork.

deaom changed the visibility of the branch 2870574-test-should-not to hidden.

deaom’s picture

Version: 8.x-4.x-dev » 5.x-dev
Status: Active » Needs review

Updated the test to set global tag separately and removed the "switching to global tag". Needs review.

  • ivnish committed 4fdcbd03 on 5.x authored by deaom
    [#2870574] feat: test should not change the scope of a flag
    
    By: joachim...
ivnish’s picture

Status: Needs review » Fixed

Merged! Thanks!

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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