Code Duplication    Length = 16-16 lines in 2 locations

eZ/Publish/Core/Repository/Tests/Service/Mock/UrlAliasTest.php 2 locations

@@ 174-189 (lines=16) @@
171
    /**
172
     * Test for the removeAliases() method.
173
     */
174
    public function testRemoveAliasesThrowsInvalidArgumentException()
175
    {
176
        $aliasList = [new URLAlias(['isCustom' => false])];
177
        $mockedService = $this->getPartlyMockedURLAliasServiceService();
178
        $this->permissionResolver
179
            ->expects($this->once())
180
            ->method('hasAccess')->with(
181
                $this->equalTo('content'),
182
                $this->equalTo('urltranslator')
183
            )
184
            ->will($this->returnValue(true));
185
186
        $this->expectException(InvalidArgumentException::class);
187
188
        $mockedService->removeAliases($aliasList);
189
    }
190
191
    /**
192
     * Test for the removeAliases() method.
@@ 3445-3460 (lines=16) @@
3442
     *
3443
     * @covers \eZ\Publish\Core\Repository\URLAliasService::removeAliases
3444
     */
3445
    public function testRemoveAliasesThrowsUnauthorizedException()
3446
    {
3447
        $this->expectException(\eZ\Publish\API\Repository\Exceptions\UnauthorizedException::class);
3448
3449
        $aliasList = [new URLAlias(['isCustom' => true])];
3450
        $mockedService = $this->getPartlyMockedURLAliasServiceService();
3451
        $this->permissionResolver
3452
            ->expects($this->once())
3453
            ->method('hasAccess')->with(
3454
                $this->equalTo('content'),
3455
                $this->equalTo('urltranslator')
3456
            )
3457
            ->will($this->returnValue(false));
3458
3459
        $mockedService->removeAliases($aliasList);
3460
    }
3461
3462
    /**
3463
     * @return \PHPUnit_Framework_MockObject_MockObject|\eZ\Publish\Core\Repository\Helper\NameSchemaService