Code Duplication    Length = 7-7 lines in 2 locations

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

@@ 265-271 (lines=7) @@
262
    public function testFindContentWhenContentLoadThrowsException($e, $index = true)
263
    {
264
        $indexer = $this->createMock(BackgroundIndexer::class);
265
        if ($index) {
266
            $indexer->expects($this->once())
267
                ->method('registerContent')
268
                ->with($this->isInstanceOf(SPIContentInfo::class));
269
        } else {
270
            $indexer->expects($this->never())->method($this->anything());
271
        }
272
273
        $service = $this->getMockBuilder(SearchService::class)
274
            ->setConstructorArgs([
@@ 873-879 (lines=7) @@
870
    public function testFindLocationsBackgroundIndexerWhenDomainMapperThrowsException($e, $index = true)
871
    {
872
        $indexer = $this->createMock(BackgroundIndexer::class);
873
        if ($index) {
874
            $indexer->expects($this->once())
875
                ->method('registerLocation')
876
                ->with($this->isInstanceOf(SPILocation::class));
877
        } else {
878
            $indexer->expects($this->never())->method($this->anything());
879
        }
880
881
        $service = $this->getMockBuilder(SearchService::class)
882
            ->setConstructorArgs([