Code Duplication    Length = 8-9 lines in 2 locations

tests/controllers/UserControllerTest.php 2 locations

@@ 145-152 (lines=8) @@
142
    /**
143
     * Tests for expired TempHash and that it redirects to the expired page
144
     */
145
    public function testAcceptExpiredTempHash()
146
    {
147
        /** @var UserInvitation $invitation */
148
        $invitation = $this->objFromFixture('UserInvitation', 'expired');
149
        $response = $this->get($this->controller->Link('accept/' . $invitation->TempHash));
150
        $this->assertEquals(302, $response->getStatusCode());
151
        $this->assertEquals('/user/expired', $response->getHeader('Location'));
152
    }
153
154
    /**
155
     * Tests if a form is returned and that expected fields are present
@@ 170-178 (lines=9) @@
167
    /**
168
     * Tests that redirected to not found if has not found
169
     */
170
    public function testSaveInviteWrongHashError()
171
    {
172
        $data = array(
173
            'HashID' => '432'
174
        );
175
        $response = $this->controller->saveInvite($data, $this->controller->AcceptForm()->loadDataFrom($data));
176
        $this->assertEquals(302, $response->getStatusCode());
177
        $this->assertEquals('/user/notfound', $response->getHeader('Location'));
178
    }
179
180
    public function testSaveInvite()
181
    {