Code Duplication    Length = 10-10 lines in 2 locations

tests/services/ApiAuthServiceTest.php 2 locations

@@ 117-126 (lines=10) @@
114
     * @param string $key
115
     * @param int $userId
116
     */
117
    public function testSaveKeyShouldReturnTrueWhenSavingSucceeds($key, $userId)
118
    {
119
        $mockUser = $this->getMockUser($userId);
120
        $mockUserKeyModel = $this->setMockUserKeyModelSaveExpectation(true);
121
        $service = $this->setMockApiAuthService('getNewUserKeyModel', 'skip', $mockUserKeyModel);
122
123
        $result = $service->saveKey($mockUser, $key);
124
125
        $this->assertTrue($result);
126
    }
127
128
    /**
129
     * @covers ::saveKey
@@ 135-144 (lines=10) @@
132
     * @param string $key
133
     * @param int $userId
134
     */
135
    public function testSaveKeyShouldReturnFalseWhenSavingFails($key, $userId)
136
    {
137
        $mockUser = $this->getMockUser($userId);
138
        $mockUserKeyModel = $this->setMockUserKeyModelSaveExpectation(false);
139
        $service = $this->setMockApiAuthService('getNewUserKeyModel', 'skip', $mockUserKeyModel);
140
141
        $result = $service->saveKey($mockUser, $key);
142
143
        $this->assertFalse($result);
144
    }
145
146
    /**
147
     * @covers ::isOptionsRequest