Passed
Push — phpstan-tests ( 6a2b78...974220 )
by Michael
61:35 queued 23s
created

QuotingTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 8
dl 0
loc 23
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A stringLiteralProvider() 0 5 1
A testQuoteStringLiteral() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Tests\DBAL\Functional\Platform;
6
7
use Doctrine\Tests\DbalFunctionalTestCase;
8
9
class QuotingTest extends DbalFunctionalTestCase
10
{
11
    /**
12
     * @dataProvider stringLiteralProvider
13
     */
14
    public function testQuoteStringLiteral(string $string) : void
15
    {
16
        $platform = $this->connection->getDatabasePlatform();
17
        $query    = $platform->getDummySelectSQL(
18
            $platform->quoteStringLiteral($string)
19
        );
20
21
        self::assertSame($string, $this->connection->fetchColumn($query));
22
    }
23
24
    /**
25
     * @return mixed[][]
26
     */
27
    public static function stringLiteralProvider() : iterable
28
    {
29
        return [
30
            'backslash' => ['\\'],
31
            'single-quote' => ["'"],
32
        ];
33
    }
34
}
35