Completed
Push — master ( b789e9...4dfee6 )
by Matteo
02:19
created

EscapeTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 1
cbo 2
dl 0
loc 24
rs 10
1
<?php
2
3
class EscapeTest extends BridgeTestCase
4
{
5
    /** @dataProvider escapingProvider */
6
    public function testRealEscapeString($expected, $unescaped)
7
    {
8
        $this->assertEquals($expected, $this->bridge->realEscapeString($unescaped));
9
    }
10
11
    /** @dataProvider escapingProvider */
12
    public function testEscapeString($expected, $unescaped)
13
    {
14
        $this->assertEquals($expected, $this->bridge->escapeString($unescaped));
15
    }
16
17
    public function escapingProvider()
18
    {
19
        return [
20
            ["1\' or \'1\' = \'1", "1' or '1' = '1"],
21
            ["O\'Reilly Media", "O'Reilly Media"],
22
            ['New line\n', "New line\n"],
23
            ["\\\\\\'test\\\\test", "\'test\\test"],
24
        ];
25
    }
26
}