@@ -10,14 +10,14 @@ public function testQueryExampleReturnsDefaultValue()
10
10
{
11
11
$ output = $ this ->execExample (escapeshellarg (PHP_BINARY ) . ' query.php ' );
12
12
13
- $ this ->assertEquals ('value ' . PHP_EOL . '42 ' . PHP_EOL , $ output );
13
+ $ this ->assertEquals ('value ' . "\n" . '42 ' . "\n" , $ output );
14
14
}
15
15
16
16
public function testQueryExampleReturnsCalculatedValueFromPlaceholderVariables ()
17
17
{
18
18
$ output = $ this ->execExample (escapeshellarg (PHP_BINARY ) . ' query.php "SELECT ?+? AS result" 1 2 ' );
19
19
20
- $ this ->assertEquals ('result ' . PHP_EOL . '3 ' . PHP_EOL , $ output );
20
+ $ this ->assertEquals ('result ' . "\n" . '3 ' . "\n" , $ output );
21
21
}
22
22
23
23
public function testQueryExampleExecutedWithCgiReturnsDefaultValueAfterContentTypeHeader ()
@@ -28,14 +28,14 @@ public function testQueryExampleExecutedWithCgiReturnsDefaultValueAfterContentTy
28
28
29
29
$ output = $ this ->execExample ('php-cgi query.php ' );
30
30
31
- $ this ->assertStringEndsWith ("\r\n\r\ n" . 'value ' . PHP_EOL . '42 ' . PHP_EOL , $ output );
31
+ $ this ->assertStringEndsWith ("\n\ n" . 'value ' . "\n" . '42 ' . "\n" , $ output );
32
32
}
33
33
34
34
public function testQueryExampleWithOpenBasedirRestrictedReturnsDefaultValue ()
35
35
{
36
36
$ output = $ this ->execExample (escapeshellarg (PHP_BINARY ) . ' -dopen_basedir= ' . escapeshellarg (dirname (__DIR__ )) . ' query.php ' );
37
37
38
- $ this ->assertEquals ('value ' . PHP_EOL . '42 ' . PHP_EOL , $ output );
38
+ $ this ->assertEquals ('value ' . "\n" . '42 ' . "\n" , $ output );
39
39
}
40
40
41
41
public function testQueryExampleWithOpenBasedirRestrictedAndAdditionalFileDescriptorReturnsDefaultValue ()
@@ -46,7 +46,7 @@ public function testQueryExampleWithOpenBasedirRestrictedAndAdditionalFileDescri
46
46
47
47
$ output = $ this ->execExample (escapeshellarg (PHP_BINARY ) . ' -dopen_basedir= ' . escapeshellarg (dirname (__DIR__ )) . ' query.php 3</dev/null ' );
48
48
49
- $ this ->assertEquals ('value ' . PHP_EOL . '42 ' . PHP_EOL , $ output );
49
+ $ this ->assertEquals ('value ' . "\n" . '42 ' . "\n" , $ output );
50
50
}
51
51
52
52
public function testQueryExampleExecutedWithCgiAndOpenBasedirRestrictedRunsDefaultPhpAndReturnsDefaultValueAfterContentTypeHeader ()
@@ -57,7 +57,7 @@ public function testQueryExampleExecutedWithCgiAndOpenBasedirRestrictedRunsDefau
57
57
58
58
$ output = $ this ->execExample ('php-cgi -dopen_basedir= ' . escapeshellarg (dirname (__DIR__ )) . ' query.php ' );
59
59
60
- $ this ->assertStringEndsWith ("\r\n\r\ n" . 'value ' . PHP_EOL . '42 ' . PHP_EOL , $ output );
60
+ $ this ->assertStringEndsWith ("\n\ n" . 'value ' . "\n" . '42 ' . "\n" , $ output );
61
61
}
62
62
63
63
private function canExecute ($ command )
@@ -73,6 +73,6 @@ private function execExample($command)
73
73
{
74
74
chdir (__DIR__ . '/../examples/ ' );
75
75
76
- return shell_exec ($ command );
76
+ return str_replace ( "\r\n" , "\n" , shell_exec ($ command) );
77
77
}
78
78
}
0 commit comments