Skip to content

Commit 755642c

Browse files
author
Steph Fox
committed
- Bring phar tests into line across all branches
1 parent 2feac2e commit 755642c

File tree

289 files changed

+16493
-572
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

289 files changed

+16493
-572
lines changed

ext/phar/tests/008.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ Phar::mapPhar truncated manifest (not enough for manifest length)
44
<?php if (!extension_loaded("phar")) die("skip");?>
55
--FILE--
66
<?php
7-
$file = (binary)"<?php
7+
$file = "<?php
88
Phar::mapPhar('hio');
99
__HALT_COMPILER(); ?>";
10-
$file .= pack('V', 500) . (binary)'notenough';
10+
$file .= pack('V', 500) . 'notenough';
1111
file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
1212
try {
1313
include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';

ext/phar/tests/009.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ Phar::mapPhar too many manifest entries
66
phar.require_hash=0
77
--FILE--
88
<?php
9-
$file = (binary)"<?php
9+
$file = b"<?php
1010
Phar::mapPhar('hio');
1111
__HALT_COMPILER(); ?>";
12-
$file .= pack('VVnVVV', 500, 500, 0x1000, 0x00000000, 0, 0) . (binary)str_repeat('A', 500);
12+
$file .= pack('VVnVVV', 500, 500, 0x1000, 0x00000000, 0, 0) . str_repeat('A', 500);
1313
file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
1414
try {
1515
include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';

ext/phar/tests/010.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ Phar::mapPhar buffer overrun
66
phar.require_hash=0
77
--FILE--
88
<?php
9-
$file = (binary)"<?php
9+
$file = b"<?php
1010
Phar::mapPhar('hio');
1111
__HALT_COMPILER(); ?>";
1212

1313
// this fails because the manifest length does not include the other 10 byte manifest data
1414

15-
$manifest = pack('V', 1) . (binary)'a' . pack('VVVVVV', 0, time(), 0, crc32((binary)''), 0x00000000, 0);
16-
$file .= pack('VVnVV', strlen($manifest), 1, 0x1000, 0x00000000, 3) . (binary)'hio' . pack('V', 0) . (binary)$manifest;
15+
$manifest = pack('V', 1) . 'a' . pack('VVVVVV', 0, time(), 0, crc32(b''), 0x00000000, 0);
16+
$file .= pack('VVnVV', strlen($manifest), 1, 0x1000, 0x00000000, 3) . 'hio' . pack('V', 0) . $manifest;
1717

1818
file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
1919
try {

ext/phar/tests/011.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ phar.require_hash=0
88
<?php
99
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
1010
$pname = 'phar://' . $fname;
11-
$file = (binary)"<?php
11+
$file = "<?php
1212
Phar::mapPhar('hio');
1313
__HALT_COMPILER(); ?>";
1414

15-
// compressed file length does not match incompressed length for an uncompressed file
15+
// compressed file length does not match incompressed lentgh for an uncompressed file
1616

1717
$files = array();
1818
$files['a'] = array('cont'=>'a','ulen'=>1,'clen'=>2);;

ext/phar/tests/012.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ phar.require_hash=0
99

1010
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
1111
$pname = 'phar://' . $fname;
12-
$file = (binary)"<?php
12+
$file = "<?php
1313
Phar::mapPhar('hio');
1414
__HALT_COMPILER(); ?>";
1515

ext/phar/tests/013.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ phar.require_hash=0
88
<?php
99
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
1010
$pname = 'phar://' . $fname;
11-
$file = (binary)"<?php __HALT_COMPILER(); ?>";
11+
$file = "<?php __HALT_COMPILER(); ?>";
1212
// filesize should be 1, and is 2
1313

1414
$files = array();

ext/phar/tests/014.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ phar.require_hash=0
88
<?php
99
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
1010
$pname = 'phar://' . $fname;
11-
$file = (binary)"<?php __HALT_COMPILER(); ?>";
11+
$file = "<?php __HALT_COMPILER(); ?>";
1212
// wrong crc32
1313

1414
$files = array();
15-
$files['a'] = array('cont'=>'a', 'crc32'=>crc32((binary)'aX'));
15+
$files['a'] = array('cont'=>'a', 'crc32'=>crc32(b'aX'));
1616
include 'files/phar_test.inc';
1717

1818
echo file_get_contents($pname.'/a');

ext/phar/tests/015.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ phar.require_hash=0
99
<?php
1010
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
1111
$pname = 'phar://' . $fname;
12-
$file = (binary)"<?php __HALT_COMPILER(); ?>";
12+
$file = "<?php __HALT_COMPILER(); ?>";
1313

1414
$files = array();
1515
$files['a'] = array('cont'=>'a','comp'=>chr(75) . chr(4) . chr(0) /* 'a' gzdeflated */, 'flags'=>0x00001000);

ext/phar/tests/015b.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ phar.require_hash=0
99
<?php
1010
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
1111
$pname = 'phar://' . $fname;
12-
$file = (binary)"<?php __HALT_COMPILER(); ?>";
12+
$file = "<?php __HALT_COMPILER(); ?>";
1313

1414
$files = array();
1515
$files['a'] = array('cont'=>'Hello World', 'comp'=>pack('H*', '425a6834314159265359065c89da0000009780400000400080060490002000310c082031a916c41d41e2ee48a70a1200cb913b40'),'flags'=>0x00002000);

ext/phar/tests/016.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ phar.require_hash=0
99
<?php
1010
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
1111
$pname = 'phar://' . $fname;
12-
$file = (binary)"<?php __HALT_COMPILER(); ?>";
12+
$file = "<?php __HALT_COMPILER(); ?>";
1313
// file length is too short
1414

1515
$files = array();

0 commit comments

Comments
 (0)