Jarves\Tests\AuthTestCase::setUp PHP Method

setUp() public method

public setUp ( )
    public function setUp()
    {
        parent::setUp();
        UserQuery::create()->filterById(1, Criteria::GREATER_THAN)->delete();
        GroupQuery::create()->filterById(1, Criteria::GREATER_THAN)->delete();
        if ($this->testGroupPk) {
            return;
        }
        $this->testGroupPk = $this->getObjects()->add('jarves/group', ['name' => 'TestGroup']);
        $this->userPk = $this->getObjects()->add('jarves/user', ['username' => 'test', 'password' => 'test', 'activate' => true, 'email' => 'test@localhost', 'groups' => [$this->testGroupPk['id']]]);
        $user = $this->getObjects()->get('jarves/user', $this->userPk['id']);
        $this->assertEquals(1, count($user['groups']));
        $this->assertEquals($this->testGroupPk['id'], $user['groups'][0]['id']);
    }
AuthTestCase