Code Duplication    Length = 29-31 lines in 2 locations

eZ/Publish/API/Repository/Tests/SearchServiceLocationTest.php 1 location

@@ 264-294 (lines=31) @@
261
     *
262
     * @see \eZ\Publish\API\Repository\SearchService::findLocations()
263
     */
264
    public function testQueryModifiedField()
265
    {
266
        // Check using get_class since the others extend SetupFactory\Legacy
267
        if (ltrim(get_class($this->getSetupFactory()), '\\') === 'eZ\Publish\API\Repository\Tests\SetupFactory\Legacy') {
268
            $this->markTestIncomplete(
269
                'Custom fields not supported by LegacySE ' .
270
                '(@todo: Legacy should fallback to just querying normal field so this should be tested here)'
271
            );
272
        }
273
274
        $query = new LocationQuery(
275
            array(
276
                'query' => new Criterion\Field(
277
                    'first_name',
278
                    Criterion\Operator::EQ,
279
                    'User'
280
                ),
281
                'offset' => 0,
282
                'limit' => 10,
283
                'sortClauses' => array(new SortClause\ContentId()),
284
            )
285
        );
286
        $query->query->setCustomField('user', 'first_name', 'custom_field');
287
288
        $this->assertQueryFixture(
289
            $query,
290
            $this->getFixtureDir() . '/QueryModifiedField.php',
291
            null,
292
            true
293
        );
294
    }
295
296
    /**
297
     * @return \eZ\Publish\API\Repository\Values\ContentType\ContentType

eZ/Publish/API/Repository/Tests/SearchServiceTest.php 1 location

@@ 2769-2797 (lines=29) @@
2766
     *
2767
     * @see \eZ\Publish\API\Repository\SearchService::findContent()
2768
     */
2769
    public function testQueryModifiedField()
2770
    {
2771
        // Check using get_class since the others extend SetupFactory\Legacy
2772
        if (ltrim(get_class($this->getSetupFactory()), '\\') === 'eZ\Publish\API\Repository\Tests\SetupFactory\Legacy') {
2773
            $this->markTestIncomplete(
2774
                'Custom fields not supported by LegacySE ' .
2775
                '(@todo: Legacy should fallback to just querying normal field so this should be tested here)'
2776
            );
2777
        }
2778
2779
        $query = new Query(
2780
            array(
2781
                'query' => new Criterion\Field(
2782
                    'first_name',
2783
                    Criterion\Operator::EQ,
2784
                    'User'
2785
                ),
2786
                'offset' => 0,
2787
                'limit' => 10,
2788
                'sortClauses' => array(new SortClause\ContentId()),
2789
            )
2790
        );
2791
        $query->query->setCustomField('user', 'first_name', 'custom_field');
2792
2793
        $this->assertQueryFixture(
2794
            $query,
2795
            $this->getFixtureDir() . '/QueryModifiedField.php'
2796
        );
2797
    }
2798
2799
    /**
2800
     * Test for the findContent() method.