Completed
Push — master ( 9146c8...39ecb4 )
by Nicolas
04:52
created

RegexpTest::testToArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19

Duplication

Lines 19
Ratio 100 %

Importance

Changes 0
Metric Value
dl 19
loc 19
c 0
b 0
f 0
rs 9.6333
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Elastica\Test\Query;
4
5
use Elastica\Query\Regexp;
6
use Elastica\Test\Base as BaseTest;
7
8
/**
9
 * @internal
10
 */
11
class RegexpTest extends BaseTest
12
{
13
    /**
14
     * @group unit
15
     */
16 View Code Duplication
    public function testToArray(): void
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
17
    {
18
        $field = 'name';
19
        $value = 'ruf';
20
        $boost = 2;
21
22
        $query = new Regexp($field, $value, $boost);
23
24
        $expectedArray = [
25
            'regexp' => [
26
                $field => [
27
                    'value' => $value,
28
                    'boost' => $boost,
29
                ],
30
            ],
31
        ];
32
33
        $this->assertequals($expectedArray, $query->toArray());
34
    }
35
}
36