Code Duplication    Length = 16-21 lines in 2 locations

eZ/Publish/API/Repository/Tests/ObjectStateServiceTest.php 2 locations

@@ 849-869 (lines=21) @@
846
     * @see \eZ\Publish\API\Repository\ObjectStateService::loadObjectState()
847
     * @depends testLoadObjectStateGroup
848
     */
849
    public function testLoadObjectState()
850
    {
851
        $repository = $this->getRepository();
852
853
        $objectStateId = $this->generateId('objectstate', 2);
854
        /* BEGIN: Use Case */
855
        // $objectStateId contains the ID of the "locked" state
856
        $objectStateService = $repository->getObjectStateService();
857
858
        $loadedObjectState = $objectStateService->loadObjectState(
859
            $objectStateId
860
        );
861
        /* END: Use Case */
862
863
        $this->assertInstanceOf(
864
            'eZ\\Publish\\API\\Repository\\Values\\ObjectState\\ObjectState',
865
            $loadedObjectState
866
        );
867
868
        return $loadedObjectState;
869
    }
870
871
    /**
872
     * testLoadObjectStateStructValues.
@@ 1300-1315 (lines=16) @@
1297
     * @see \eZ\Publish\API\Repository\ObjectStateService::getContentCount()
1298
     * @depends testLoadObjectState
1299
     */
1300
    public function testGetContentCount()
1301
    {
1302
        $repository = $this->getRepository();
1303
1304
        $notLockedObjectStateId = $this->generateId('objectstate', 1);
1305
        /* BEGIN: Use Case */
1306
        // $notLockedObjectStateId is the ID of the state "not_locked"
1307
        $objectStateService = $repository->getObjectStateService();
1308
1309
        $notLockedObjectState = $objectStateService->loadObjectState($notLockedObjectStateId);
1310
1311
        $objectCount = $objectStateService->getContentCount($notLockedObjectState);
1312
        /* END: Use Case */
1313
1314
        $this->assertEquals(18, $objectCount);
1315
    }
1316
1317
    /**
1318
     * Test for the deleteObjectState() method.