Completed
Push — master ( 9de5b8...ddab96 )
by Matteo
03:46
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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testRealEscapeString() 0 4 1
A testEscapeString() 0 4 1
A escapingProvider() 0 9 1
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
}