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

getParameterNamesStartingOrEndingWithAColon()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 8
nc 1
nop 0
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