Skip to content

Commit a70d75f

Browse files
committed
Fix tests
1 parent 62d6baf commit a70d75f

File tree

9 files changed

+22
-13
lines changed

9 files changed

+22
-13
lines changed

ext/date/php_date.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ class DatePeriod implements IteratorAggregate
396396
/**
397397
* @param DateTimeInterface|string $start
398398
* @param DateInterval|int $interval
399-
* @param DateTimeInterface $end
399+
* @param DateTimeInterface|int $end
400400
* @param int $options
401401
*/
402402
public function __construct($start, $interval = UNKNOWN, $end = UNKNOWN, $options = UNKNOWN) {}

ext/date/php_date_arginfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: abe167ed6e272ea3890d6205f7384b92680243e4 */
2+
* Stub hash: fee95924adec03c89fdd677ec26bb6eea34d4b3c */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_strtotime, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
55
ZEND_ARG_TYPE_INFO(0, datetime, IS_STRING, 0)

ext/phar/phar_object.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4296,7 +4296,7 @@ PHP_METHOD(Phar, extractTo)
42964296
php_stream *fp;
42974297
php_stream_statbuf ssb;
42984298
char *pathto;
4299-
zend_string *filename;
4299+
zend_string *filename = NULL;
43004300
size_t pathto_len;
43014301
int ret;
43024302
zval *zval_file;

ext/phar/tests/cache_list/files/frontcontroller16.phar.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ echo "hi";
77
$a->setStub('<?php
88
try {
99
Phar::webPhar("test.phar", "/index.php", null, array(), array("fail", "here"));
10-
} catch (Exception $e) {
10+
} catch (TypeError|Exception $e) {
1111
die($e->getMessage() . "\n");
1212
}
1313
echo "oops did not run\n";

ext/phar/tests/cache_list/frontcontroller31.phpt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,9 @@ REQUEST_URI=/frontcontroller31.php
1212
Content-type: text/html; charset=UTF-8
1313
--FILE_EXTERNAL--
1414
files/frontcontroller16.phar
15-
--EXPECT--
16-
phar error: invalid rewrite callback
15+
--EXPECTF--
16+
Fatal error: Uncaught TypeError: Phar::webPhar(): Argument #5 ($rewrites) must be a valid callback or null, class "fail" not found in %s:%d
17+
Stack trace:
18+
#0 %s(%d): Phar::webPhar('test.phar', '/index.php', '', Array, Array)
19+
#1 {main}
20+
thrown in %s on line %d

ext/phar/tests/files/frontcontroller16.phar.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ echo "hi";
77
$a->setStub('<?php
88
try {
99
Phar::webPhar("test.phar", "/index.php", null, array(), array("fail", "here"));
10-
} catch (Exception $e) {
10+
} catch (TypeError|Exception $e) {
1111
die($e->getMessage() . "\n");
1212
}
1313
echo "oops did not run\n";

ext/phar/tests/frontcontroller31.phpt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,9 @@ REQUEST_URI=/frontcontroller31.php
1111
Content-type: text/html; charset=UTF-8
1212
--FILE_EXTERNAL--
1313
files/frontcontroller16.phar
14-
--EXPECT--
15-
phar error: invalid rewrite callback
14+
--EXPECTF--
15+
Fatal error: Uncaught TypeError: Phar::webPhar(): Argument #5 ($rewrites) must be a valid callback or null, class "fail" not found in %s:%d
16+
Stack trace:
17+
#0 %s(%d): Phar::webPhar('test.phar', '/index.php', '', Array, Array)
18+
#1 {main}
19+
thrown in %s on line %d

ext/phar/tests/phar_buildfromiterator1.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ phar.readonly=0
1010
$phar = new Phar(__DIR__ . '/buildfromiterator1.phar');
1111
try {
1212
ini_set('phar.readonly', 1);
13-
$phar->buildFromIterator(1);
13+
14+
$phar->buildFromIterator(new ArrayIterator([]));
1415
} catch (Exception $e) {
1516
var_dump(get_class($e));
1617
echo $e->getMessage() . "\n";

ext/phar/tests/phar_extract.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ var_dump(file_get_contents(__DIR__ . '/extract1-2/file2.txt'));
4545
var_dump(is_dir(__DIR__ . '/extract1-2/one/level'));
4646

4747
try {
48-
$a->extractTo(__DIR__ . '/whatever', 134);
49-
} catch (Exception $e) {
48+
$a->extractTo(__DIR__ . '/whatever', new stdClass());
49+
} catch (TypeError $e) {
5050
echo $e->getMessage(), "\n";
5151
}
5252

@@ -141,7 +141,7 @@ string(2) "hi"
141141
string(3) "hi3"
142142
string(3) "hi2"
143143
bool(false)
144-
Invalid argument, expected a filename (string) or array of filenames
144+
Phar::extractTo(): Argument #2 ($files) must be of type string|array|null, stdClass given
145145
Phar::extractTo(): Argument #1 ($pathto) must be a valid path, array given
146146
Invalid argument, extraction path must be non-zero length
147147
Unable to use path "%soops" for extraction, it is a file, must be a directory

0 commit comments

Comments
 (0)