Completed
Push — 2.8 ( c0195c...8d2399 )
by Sergei
21:38
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
namespace Doctrine\Tests\DBAL\Functional\Platform;
4
5
use Doctrine\Tests\DbalFunctionalTestCase;
6
7
class QuotingTest extends DbalFunctionalTestCase
8
{
9
    /**
10
     * @dataProvider stringLiteralProvider
11
     */
12
    public function testQuoteStringLiteral(string $string) : void
13
    {
14
        $platform = $this->_conn->getDatabasePlatform();
15
        $query    = $platform->getDummySelectSQL(
16
            $platform->quoteStringLiteral($string)
17
        );
18
19
        self::assertSame($string, $this->_conn->fetchColumn($query));
20
    }
21
22
    /**
23
     * @return mixed[][]
24
     */
25
    public static function stringLiteralProvider() : iterable
26
    {
27
        return [
28
            'backslash' => ['\\'],
29
            'single-quote' => ["'"],
30
        ];
31
    }
32
}
33