Completed
Push — master ( 9de5b8...ddab96 )
by Matteo
03:46
created

EscapeTest::testRealEscapeString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
3
class EscapeTest extends BridgeTestCase
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
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
}