Code Duplication    Length = 9-12 lines in 3 locations

eZ/Publish/API/Repository/Tests/Values/User/Limitation/RolePolicyLimitationTest.php 1 location

@@ 105-113 (lines=9) @@
102
     * @param $subtreePathString
103
     * @return int|null
104
     */
105
    protected function getSubtreeLocationsCount($subtreePathString)
106
    {
107
        $criterion = new Criterion\Subtree($subtreePathString);
108
        $query = new LocationQuery(['filter' => $criterion]);
109
110
        $result = $this->getRepository()->getSearchService()->findLocations($query);
111
112
        return $result->totalCount;
113
    }
114
115
    /**
116
     * Create test User in the given User Group.

eZ/Publish/API/Repository/Tests/Regression/PureNegativeQueryTest.php 2 locations

@@ 259-270 (lines=12) @@
256
     * @param \eZ\Publish\API\Repository\Values\Content\Query\Criterion $criterion
257
     * @param int $totalCount
258
     */
259
    public function testMatchAllLocationQuery($criterion, $totalCount)
260
    {
261
        $query = new LocationQuery(
262
            [
263
                'query' => $criterion,
264
            ]
265
        );
266
267
        $result = $this->getRepository()->getSearchService()->findLocations($query);
268
269
        $this->assertEquals($totalCount, $result->totalCount);
270
    }
271
272
    /**
273
     * @dataProvider providerForTestMatchAll
@@ 278-289 (lines=12) @@
275
     * @param \eZ\Publish\API\Repository\Values\Content\Query\Criterion $criterion
276
     * @param int $totalCount
277
     */
278
    public function testMatchAllLocationFilter($criterion, $totalCount)
279
    {
280
        $query = new LocationQuery(
281
            [
282
                'filter' => $criterion,
283
            ]
284
        );
285
286
        $result = $this->getRepository()->getSearchService()->findLocations($query);
287
288
        $this->assertEquals($totalCount, $result->totalCount);
289
    }
290
}
291