@@ -60,7 +60,6 @@ public static function unsafeStringsProvider(): array
6060 'carriage return ' => ["line1 \rline2 " , "\$'line1 \\rline2' " ],
6161 'form feed ' => ["page \fbreak " , "\$'page \\fbreak' " ],
6262 'vertical tab ' => ["vert \vtab " , "\$'vert \\vtab' " ],
63- 'null byte ' => ["null \0byte " , "\$'null \\0byte' " ],
6463 'semicolon ' => ['cmd; rm -rf / ' , "\$'cmd; rm -rf /' " ],
6564 'pipe ' => ['a | b ' , "\$'a | b' " ],
6665 'ampersand ' => ['a & b ' , "\$'a & b' " ],
@@ -85,11 +84,17 @@ public function testMultipleEscapes()
8584
8685 public function testAllSpecialCharsAtOnce ()
8786 {
88- $ input = "' \\\f\n\r\t\v\0 " ;
89- $ expected = "\$' \\' \\\\\\f \\n \\r \\t \\v \\ 0 ' " ;
87+ $ input = "' \\\f\n\r\t\v" ;
88+ $ expected = "\$' \\' \\\\\\f \\n \\r \\t \\v' " ;
9089 self ::assertEquals ($ expected , quote ($ input ));
9190 }
9291
92+ public function testNullByteRejected ()
93+ {
94+ $ this ->expectException (\InvalidArgumentException::class);
95+ quote ("null \0byte " );
96+ }
97+
9398 public function testUnicodeContent ()
9499 {
95100 self ::assertEquals ("\$'héllo wörld' " , quote ('héllo wörld ' ));
0 commit comments