// 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!

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.