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

QuotingTest::stringLiteralProvider()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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