Passed
Pull Request — develop (#6881)
by
unknown
63:15
created

ParameterTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testParameterNameStartingOrEndingWithAColon() 0 4 1
A getParameterNamesStartingOrEndingWithAColon() 0 11 1
1
<?php
2
3
namespace Doctrine\Tests\ORM\Query;
4
5
use Doctrine\ORM\Query\Parameter;
6
use PHPUnit\Framework\TestCase;
7
8
class ParameterTest extends TestCase
9
{
10
    /**
11
     * @dataProvider getParameterNamesStartingOrEndingWithAColon
12
     * @expectedException \InvalidArgumentException
13
     * @expectedExceptionMessage A parameter name cannot start or end with ":".
14
     */
15
    public function testParameterNameStartingOrEndingWithAColon(string $name): void
16
    {
17
        new Parameter($name, 'value');
18
    }
19
20
    /**
21
     * @return array
22
     */
23
    public function getParameterNamesStartingOrEndingWithAColon(): array
24
    {
25
        return array(
26
            array(':name'),
27
            array('::name'),
28
            array('name:'),
29
            array('name::'),
30
            array(':name:'),
31
            array('::name::')
32
        );
33
    }
34
}
35