Code Duplication    Length = 7-53 lines in 7 locations

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

@@ 58-71 (lines=14) @@
55
        $result = $this->getRepository()->getSearchService()->findContent($query);
56
    }
57
58
    public function searchContentQueryProvider()
59
    {
60
        return [
61
            [
62
                '/1/2/',
63
            ],
64
            [
65
                ['/1/2/', '/1/2/4/'],
66
            ],
67
            [
68
                '/1/id0/',
69
            ],
70
        ];
71
    }
72
73
    public function searchContentQueryWithInvalidDataProvider()
74
    {
@@ 73-86 (lines=14) @@
70
        ];
71
    }
72
73
    public function searchContentQueryWithInvalidDataProvider()
74
    {
75
        return [
76
            [
77
                '/1/2',
78
            ],
79
            [
80
                ['/1/2/', '/1/2/4'],
81
            ],
82
            [
83
                '/1/id0',
84
            ],
85
        ];
86
    }
87
}
88

eZ/Publish/Core/FieldType/Tests/RichText/Converter/LinkTest.php 1 location

@@ 56-108 (lines=53) @@
53
    /**
54
     * @return array
55
     */
56
    public function providerLinkXmlSample()
57
    {
58
        return [
59
            [
60
                '<?xml version="1.0" encoding="UTF-8"?>
61
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ezxhtml="http://ez.no/xmlns/ezpublish/docbook/xhtml" version="5.0-variant ezpublish-1.0">
62
  <title>Link example</title>
63
  <para>
64
    <link xlink:href="/test">Link text</link>
65
  </para>
66
</section>',
67
                '<?xml version="1.0" encoding="UTF-8"?>
68
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ezxhtml="http://ez.no/xmlns/ezpublish/docbook/xhtml" version="5.0-variant ezpublish-1.0">
69
  <title>Link example</title>
70
  <para>
71
    <link xlink:href="/test">Link text</link>
72
  </para>
73
</section>',
74
            ],
75
            [
76
                '<?xml version="1.0" encoding="UTF-8"?>
77
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ezxhtml="http://ez.no/xmlns/ezpublish/docbook/xhtml" version="5.0-variant ezpublish-1.0">
78
  <title>Link example</title>
79
  <para>
80
    <link xlink:href="/test#anchor">Link text</link>
81
  </para>
82
</section>',
83
                '<?xml version="1.0" encoding="UTF-8"?>
84
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ezxhtml="http://ez.no/xmlns/ezpublish/docbook/xhtml" version="5.0-variant ezpublish-1.0">
85
  <title>Link example</title>
86
  <para>
87
    <link xlink:href="/test#anchor">Link text</link>
88
  </para>
89
</section>',
90
            ],
91
            [
92
                '<?xml version="1.0" encoding="UTF-8"?>
93
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ezxhtml="http://ez.no/xmlns/ezpublish/docbook/xhtml" version="5.0-variant ezpublish-1.0">
94
  <title>Link example</title>
95
  <ezembed>
96
    <ezlink xlink:href="/test#anchor"/>
97
  </ezembed>
98
</section>',
99
                '<?xml version="1.0" encoding="UTF-8"?>
100
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ezxhtml="http://ez.no/xmlns/ezpublish/docbook/xhtml" version="5.0-variant ezpublish-1.0">
101
  <title>Link example</title>
102
  <ezembed>
103
    <ezlink xlink:href="/test#anchor" href_resolved="/test#anchor"/>
104
  </ezembed>
105
</section>',
106
            ],
107
        ];
108
    }
109
110
    /**
111
     * Test conversion of ezurl://<id> links.

eZ/Publish/Core/MVC/Symfony/SiteAccess/Tests/RouterMapURITest.php 1 location

@@ 69-75 (lines=7) @@
66
        $this->assertSame($fullUri, $unserializedMatcher->analyseLink($linkUri));
67
    }
68
69
    public function setRequestProvider()
70
    {
71
        return [
72
            [['foo' => 'bar'], '/bar/baz', 'bar'],
73
            [['foo' => 'Äpfel'], '/%C3%84pfel/foo', 'Äpfel'],
74
        ];
75
    }
76
77
    public function fixupURIProvider()
78
    {

eZ/Bundle/EzPublishCoreBundle/Tests/Imagine/Filter/Loader/SwirlFilterLoaderTest.php 1 location

@@ 67-75 (lines=9) @@
64
        $this->assertSame($image, $this->loader->load($image, [$degrees]));
65
    }
66
67
    public function loadWithOptionProvider()
68
    {
69
        return [
70
            [10],
71
            [60],
72
            [60.34],
73
            [180.123],
74
        ];
75
    }
76
}
77

eZ/Bundle/EzPublishCoreBundle/Tests/Routing/DefaultRouterTest.php 1 location

@@ 125-133 (lines=9) @@
122
        $this->assertSame($url, $router->generate(__METHOD__));
123
    }
124
125
    public function providerGenerateNoSiteAccess()
126
    {
127
        return [
128
            ['/foo/bar'],
129
            ['/foo/bar/baz?truc=muche&tata=toto'],
130
            ['http://ez.no/Products/eZ-Publish-CMS'],
131
            ['http://www.metalfrance.net/decouvertes/edge-caress-inverse-ep'],
132
        ];
133
    }
134
135
    /**
136
     * @dataProvider providerGenerateWithSiteAccess

eZ/Bundle/EzPublishRestBundle/Tests/Functional/SearchViewTest.php 1 location

@@ 298-343 (lines=46) @@
295
        ];
296
    }
297
298
    public function jsonProvider(): array
299
    {
300
        return [
301
            [
302
                <<< JSON
303
"OR": [
304
    {
305
        "ContentRemoteIdCriterion": "test-name"
306
    },
307
    {
308
        "ContentRemoteIdCriterion": "fancy-name"
309
    }
310
]
311
JSON
312
,
313
                2,
314
            ],
315
            [
316
                <<< JSON
317
"OR": {
318
    "ContentRemoteIdCriterion": [
319
        "test-name",
320
        "fancy-name"
321
    ]
322
}
323
JSON
324
,
325
            2,
326
            ],
327
            [
328
                <<< JSON
329
"AND": {
330
    "OR": {
331
        "ContentRemoteIdCriterion": [
332
            "test-name",
333
            "fancy-name"
334
        ]
335
    },
336
    "ContentRemoteIdCriterion": "test-name"
337
}
338
JSON
339
,
340
                1,
341
            ],
342
        ];
343
    }
344
345
    /**
346
     * @param string $name