Code Duplication    Length = 15-17 lines in 3 locations

eZ/Publish/Core/Persistence/Legacy/Tests/Content/Section/SectionHandlerTest.php 3 locations

@@ 268-282 (lines=15) @@
265
    /**
266
     * @covers eZ\Publish\Core\Persistence\Legacy\Content\Section\Handler::assign
267
     */
268
    public function testAssign()
269
    {
270
        $handler = $this->getSectionHandler();
271
272
        $gatewayMock = $this->getGatewayMock();
273
274
        $gatewayMock->expects($this->once())
275
            ->method('assignSectionToContent')
276
            ->with(
277
                $this->equalTo(23),
278
                $this->equalTo(42)
279
            );
280
281
        $result = $handler->assign(23, 42);
282
    }
283
284
    /**
285
     * @covers eZ\Publish\Core\Persistence\Legacy\Content\Section\Handler::policiesCount
@@ 287-303 (lines=17) @@
284
    /**
285
     * @covers eZ\Publish\Core\Persistence\Legacy\Content\Section\Handler::policiesCount
286
     */
287
    public function testPoliciesCount()
288
    {
289
        $handler = $this->getSectionHandler();
290
291
        $gatewayMock = $this->getGatewayMock();
292
293
        $gatewayMock->expects($this->once())
294
            ->method('countPoliciesUsingSection')
295
            ->with(
296
                $this->equalTo(1)
297
            )
298
            ->will(
299
                $this->returnValue(7)
300
            );
301
302
        $result = $handler->policiesCount(1);
303
    }
304
305
    /**
306
     * @covers eZ\Publish\Core\Persistence\Legacy\Content\Section\Handler::countRoleAssignmentsUsingSection
@@ 308-324 (lines=17) @@
305
    /**
306
     * @covers eZ\Publish\Core\Persistence\Legacy\Content\Section\Handler::countRoleAssignmentsUsingSection
307
     */
308
    public function testCountRoleAssignmentsUsingSection()
309
    {
310
        $handler = $this->getSectionHandler();
311
312
        $gatewayMock = $this->getGatewayMock();
313
314
        $gatewayMock->expects($this->once())
315
            ->method('countRoleAssignmentsUsingSection')
316
            ->with(
317
                $this->equalTo(1)
318
            )
319
            ->will(
320
                $this->returnValue(0)
321
            );
322
323
        $handler->countRoleAssignmentsUsingSection(1);
324
    }
325
326
    /**
327
     * Returns the section handler to test.