Completed
Push — php70 ( 6d5056...0a8a39 )
by Wim
02:10
created

RemovedGlobalVariablesSniffTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 19
rs 10
wmc 1
lcom 1
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testHttpRawPostData() 0 11 1
1
<?php
2
/**
3
 * Removed global variables sniff test file
4
 *
5
 * @package PHPCompatibility
6
 */
7
8
9
/**
10
 * Removed global variables sniff tests
11
 *
12
 * @uses BaseSniffTest
13
 * @package PHPCompatibility
14
 * @author Wim Godden <[email protected]>
15
 */
16
class RemovedGlobalVariablesSniffTest  extends BaseSniffTest
17
{
18
    /**
19
     * HTTP_RAW_POST_DATA
20
     *
21
     * @return void
22
     */
23
    public function testHttpRawPostData()
24
    {
25
        $file = $this->sniffFile('sniff-examples/removed_global_variables.php', '5.5');
26
        $this->assertNoViolation($file);
27
        
28
        $file = $this->sniffFile('sniff-examples/removed_global_variables.php', '5.6');
29
        $this->assertWarning($file, 3, "Global variable 'HTTP_RAW_POST_DATA' is deprecated since PHP 5.6 - use php://input instead");
30
        
31
        $file = $this->sniffFile('sniff-examples/removed_global_variables.php', '7.0');
32
        $this->assertError($file, 3, "Global variable 'HTTP_RAW_POST_DATA' is deprecated since PHP 5.6 and removed since PHP 7.0 - use php://input instead");
33
    }
34
}
35