Code Duplication    Length = 16-17 lines in 2 locations

eZ/Publish/Core/Persistence/Legacy/Tests/Content/Type/ContentTypeHandlerTest.php 1 location

@@ 879-895 (lines=17) @@
876
     * @expectedException \eZ\Publish\Core\Persistence\Legacy\Exception\RemoveLastGroupFromType
877
     * @expectedExceptionMessage Type with ID "23" in status "1" cannot be unlinked from its last group.
878
     */
879
    public function testUnlinkFailure()
880
    {
881
        $gatewayMock = $this->getGatewayMock();
882
        $gatewayMock->expects($this->once())
883
            ->method('countGroupsForType')
884
            ->with(
885
                $this->equalTo(23),
886
                $this->equalTo(1)
887
            )
888
            // Only 1 group assigned
889
            ->will($this->returnValue(1));
890
891
        $mapperMock = $this->getMapperMock();
892
893
        $handler = $this->getHandler();
894
        $res = $handler->unlink(3, 23, 1);
895
    }
896
897
    /**
898
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::getFieldDefinition

eZ/Publish/Core/Persistence/Legacy/Tests/Content/ContentHandlerTest.php 1 location

@@ 1477-1492 (lines=16) @@
1474
    /**
1475
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Handler::setStatus
1476
     */
1477
    public function testSetStatus()
1478
    {
1479
        $handler = $this->getContentHandler();
1480
1481
        $mapperMock = $this->getMapperMock();
1482
        $gatewayMock = $this->getGatewayMock();
1483
1484
        $gatewayMock->expects($this->once())
1485
            ->method('setStatus')
1486
            ->with(23, 5, 2)
1487
            ->will($this->returnValue(true));
1488
1489
        $this->assertTrue(
1490
            $handler->setStatus(23, 2, 5)
1491
        );
1492
    }
1493
1494
    /**
1495
     * Returns the handler to test.