Skip to content

improve phpunit-bootstrap #256

@simonLeary42

Description

@simonLeary42
  • replace switchUser / getUser* with becomeUser*
  • add assertions into each becomeUser

this will make tests simpler to write since they don't need to sanity check the initial state of the database like this:

        switchUser(...getUserIsPIHasNoMembersNoMemberRequests());
        $pi_group = $USER->getPIGroup();
        $gid = $pi_group->getPIUID();
        $this->assertTrue($USER->isPI());
        $this->assertEquals([], $pi_group->getGroupMembers());
        $this->assertEquals([], $SQL->getRequests($gid));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions