Code Duplication    Length = 24-24 lines in 2 locations

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

@@ 94-117 (lines=24) @@
91
     *
92
     * @see \eZ\Publish\API\Repository\SearchService::findLocations()
93
     */
94
    public function testFieldCollectionContains()
95
    {
96
        $testContent = $this->createMultipleCountriesContent();
97
98
        $query = new LocationQuery(
99
            array(
100
                'query' => new Criterion\Field(
101
                    'countries',
102
                    Criterion\Operator::CONTAINS,
103
                    'Belgium'
104
                ),
105
            )
106
        );
107
108
        $repository = $this->getRepository();
109
        $searchService = $repository->getSearchService();
110
        $result = $searchService->findLocations($query);
111
112
        $this->assertEquals(1, $result->totalCount);
113
        $this->assertEquals(
114
            $testContent->contentInfo->mainLocationId,
115
            $result->searchHits[0]->valueObject->id
116
        );
117
    }
118
119
    /**
120
     * Test for the findLocations() method.

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

@@ 1252-1275 (lines=24) @@
1249
     *
1250
     * @see \eZ\Publish\API\Repository\SearchService::findContent()
1251
     */
1252
    public function testFieldCollectionContains()
1253
    {
1254
        $testContent = $this->createMultipleCountriesContent();
1255
1256
        $query = new Query(
1257
            array(
1258
                'query' => new Criterion\Field(
1259
                    'countries',
1260
                    Criterion\Operator::CONTAINS,
1261
                    'Belgium'
1262
                ),
1263
            )
1264
        );
1265
1266
        $repository = $this->getRepository();
1267
        $searchService = $repository->getSearchService();
1268
        $result = $searchService->findContent($query);
1269
1270
        $this->assertEquals(1, $result->totalCount);
1271
        $this->assertEquals(
1272
            $testContent->id,
1273
            $result->searchHits[0]->valueObject->id
1274
        );
1275
    }
1276
1277
    /**
1278
     * Test for the findContent() method.