Code Duplication    Length = 17-27 lines in 2 locations

eZ/Publish/Core/Persistence/Legacy/Tests/Content/Location/Gateway/DoctrineDatabaseTrashTest.php 1 location

@@ 101-117 (lines=17) @@
98
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway\DoctrineDatabase::untrashLocation
99
     * @dataProvider getUntrashedLocationValues
100
     */
101
    public function testUntrashLocationDefault($property, $value)
102
    {
103
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php');
104
        $handler = $this->getLocationGateway();
105
        $handler->trashLocation(71);
106
107
        $handler->untrashLocation(71);
108
109
        $query = $this->handler->createSelectQuery();
110
        $this->assertQueryResult(
111
            [[$value]],
112
            $query
113
                ->select($property)
114
                ->from('ezcontentobject_tree')
115
                ->where($query->expr->in('contentobject_id', [69]))
116
        );
117
    }
118
119
    /**
120
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway\DoctrineDatabase::untrashLocation

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

@@ 903-929 (lines=27) @@
900
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\DoctrineDatabase::setCommonTypeColumns
901
     * @dataProvider getTypeUpdateExpectations
902
     */
903
    public function testUpdateType($fieldName, $expectedValue)
904
    {
905
        $this->insertDatabaseFixture(
906
            __DIR__ . '/_fixtures/existing_types.php'
907
        );
908
909
        $gateway = $this->getGateway();
910
911
        $type = $this->getUpdateTypeFixture();
912
913
        $gateway->updateType(1, 0, $type);
914
915
        $this->assertQueryResult(
916
            [
917
                [
918
                    $fieldName => $expectedValue,
919
                ],
920
            ],
921
            $this->getDatabaseHandler()
922
                ->createSelectQuery()
923
                ->select(
924
                    $fieldName
925
                )->from('ezcontentclass')
926
                ->where('id = 1 AND version = 0'),
927
            "Incorrect value stored for '{$fieldName}'."
928
        );
929
    }
930
931
    /**
932
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\DoctrineDatabase::deleteTypeNameData