Skip to content

Commit c5c1d0b

Browse files
committed
Fix tests
1 parent ceb028c commit c5c1d0b

File tree

13 files changed

+140
-10
lines changed

13 files changed

+140
-10
lines changed

tests/swoole_coroutine/bailout/error_internal.phpt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,9 @@ go(function () {
1414
?>
1515
--EXPECTF--
1616
Fatal error: Allowed memory size of %d bytes exhausted %s
17+
--EXPECTF_85--
18+
Fatal error: Allowed memory size of %d bytes exhausted %s
19+
Stack trace:
20+
#0 %s(%d): str_repeat('A', %d)
21+
#1 [internal function]: {%s:%d}()
22+
#2 {main}

tests/swoole_coroutine/bailout/error_internal2.phpt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,9 @@ go(function () {
1616
?>
1717
--EXPECTF--
1818
Fatal error: Allowed memory size of %d bytes exhausted %s
19+
--EXPECTF_85--
20+
Fatal error: Allowed memory size of %d bytes exhausted %s
21+
Stack trace:
22+
#0 %s(%d): str_repeat('A', %d)
23+
#1 [internal function]: {closure:{closure:%s:%d}:%d}()
24+
#2 {main}

tests/swoole_coroutine/destruct/destruct2.phpt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,12 @@ call function
3737
end
3838

3939
Fatal error: go(): can not use coroutine in __destruct after php_request_shutdown %s
40+
--EXPECTF_85--
41+
call function
42+
end
43+
44+
Fatal error: go(): can not use coroutine in __destruct after php_request_shutdown %s
45+
Stack trace:
46+
#0 %s(%d): go(Object(Closure))
47+
#1 [internal function]: T2->__destruct()
48+
#2 {main}

tests/swoole_curl/fatal_error_in_callback.phpt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,13 @@ echo "Done\n";
5151
Fatal error: test in %s on line %d
5252

5353
Warning: curl_close(): Attempt to close cURL handle from a callback in %s on line %d
54+
--EXPECTF_85--
55+
Fatal error: test in %s on line %d
56+
Stack trace:
57+
#0 %s(%d): trigger_error('test', %d)
58+
#1 [internal function]: {closure:{closure:%s:%d}:%d}(Object(CurlHandle), '<html>\r\n<head>\r...')
59+
#2 %s(%d): curl_exec(Object(CurlHandle))
60+
#3 [internal function]: {closure:%s:%d}()
61+
#4 {main}
62+
63+
Warning: curl_close(): Attempt to close cURL handle from a callback in %s on line %d

tests/swoole_http_server/task/enable_coroutine_with_wrong_usage.phpt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,9 @@ $pm->run();
3636
?>
3737
--EXPECTF--
3838
Fatal error: Swoole\Server::finish(): please use Swoole\Server\Task->finish instead when task_enable_coroutine is enable in %s/task/enable_coroutine_with_wrong_usage.php on line %d
39+
--EXPECTF_85--
40+
Fatal error: Swoole\Server::finish(): please use Swoole\Server\Task->finish instead when task_enable_coroutine is enable in %s/task/enable_coroutine_with_wrong_usage.php on line %d
41+
Stack trace:
42+
#0 %s(%d): Swoole\Server->finish('bar')
43+
#1 [internal function]: {closure:{closure:%s:%d}:%d}(Object(Swoole\Http\Server), Object(Swoole\Server\Task))
44+
#2 {main}

tests/swoole_pdo_sqlite/pdo_sqlite_extendederror_attr.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ run(function() {
3131

3232

3333
echo "Creating new PDO with Extended Result Codes turned on" . PHP_EOL;
34-
$db = new PDO('sqlite::memory:', '', '', [PDO::SQLITE_ATTR_EXTENDED_RESULT_CODES => TRUE]);
34+
$const = PHP_VERSION_ID >= 80500 ? PDO\SQLITE::ATTR_EXTENDED_RESULT_CODES : PDO::SQLITE_ATTR_EXTENDED_RESULT_CODES;
35+
$db = new PDO('sqlite::memory:', '', '', [$const => TRUE]);
3536
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT);
3637

3738
$db->exec("CREATE TABLE dog ( id INTEGER PRIMARY KEY, name TEXT, annoying INTEGER )");

tests/swoole_pdo_sqlite/pdo_sqlite_open_flags.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ run(function () {
2020

2121
var_dump($db->exec('CREATE TABLE test1 (id INT);'));
2222
if (PHP_VERSION_ID >= 80500) {
23-
$key = Pdo\Sqlite::ATTR_READONLY_STATEMENT;
23+
$key = Pdo\Sqlite::ATTR_OPEN_FLAGS;
2424
$value = Pdo\SQLITE::OPEN_READONLY;
2525
} else {
2626
$key = PDO::SQLITE_ATTR_OPEN_FLAGS;

tests/swoole_pdo_sqlite/pdo_sqlite_statement_getattribute.phpt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ run(function() {
1717

1818
$st = $db->prepare('SELECT 1;');
1919

20-
var_dump($st->getAttribute(PDO::SQLITE_ATTR_READONLY_STATEMENT));
20+
$const = PHP_VERSION_ID >= 80500 ? PDO\SQLITE::ATTR_READONLY_STATEMENT: PDO::SQLITE_ATTR_READONLY_STATEMENT;
21+
22+
var_dump($st->getAttribute($const));
2123

2224
$st = $db->prepare('CREATE TABLE test (a TEXT);');
2325

24-
var_dump($st->getAttribute(PDO::SQLITE_ATTR_READONLY_STATEMENT));
26+
var_dump($st->getAttribute($const));
2527
});
2628
?>
2729
--EXPECT--

tests/swoole_server/addProcess_with_error.phpt

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,54 @@ $pm->run();
5050
--EXPECTF--
5151
sleep start then sleep end
5252

53-
Fatal error: ERROR in %s/tests/swoole_server/addProcess_with_error.php on line 31
53+
Fatal error: ERROR in %s/tests/swoole_server/addProcess_with_error.php on line %d
5454
sleep start then sleep end
5555

56-
Fatal error: ERROR in %s/tests/swoole_server/addProcess_with_error.php on line 31
56+
Fatal error: ERROR in %s/tests/swoole_server/addProcess_with_error.php on line %d
5757
sleep start then sleep end
5858

59-
Fatal error: ERROR in %s/tests/swoole_server/addProcess_with_error.php on line 31
59+
Fatal error: ERROR in %s/tests/swoole_server/addProcess_with_error.php on line %d
6060
sleep start then sleep end
6161

62-
Fatal error: ERROR in %s/tests/swoole_server/addProcess_with_error.php on line 31
62+
Fatal error: ERROR in %s/tests/swoole_server/addProcess_with_error.php on line %d
6363
sleep start then sleep end
6464

65-
Fatal error: ERROR in %s/tests/swoole_server/addProcess_with_error.php on line 31
65+
Fatal error: ERROR in %s/tests/swoole_server/addProcess_with_error.php on line %d
66+
DONE
67+
--EXPECTF_85--
68+
sleep start then sleep end
69+
70+
Fatal error: ERROR in %s/tests/swoole_server/addProcess_with_error.php on line %d
71+
Stack trace:
72+
#0 %s(%d): trigger_error('ERROR', 256)
73+
#1 [internal function]: Process4->{closure:Process4::run():%d}()
74+
#2 {main}
75+
sleep start then sleep end
76+
77+
Fatal error: ERROR in %s/tests/swoole_server/addProcess_with_error.php on line %d
78+
Stack trace:
79+
#0 %s(%d): trigger_error('ERROR', 256)
80+
#1 [internal function]: Process4->{closure:Process4::run():%d}()
81+
#2 {main}
82+
sleep start then sleep end
83+
84+
Fatal error: ERROR in %s/tests/swoole_server/addProcess_with_error.php on line %d
85+
Stack trace:
86+
#0 %s(%d): trigger_error('ERROR', 256)
87+
#1 [internal function]: Process4->{closure:Process4::run():%d}()
88+
#2 {main}
89+
sleep start then sleep end
90+
91+
Fatal error: ERROR in %s/tests/swoole_server/addProcess_with_error.php on line %d
92+
Stack trace:
93+
#0 %s(%d): trigger_error('ERROR', 256)
94+
#1 [internal function]: Process4->{closure:Process4::run():%d}()
95+
#2 {main}
96+
sleep start then sleep end
97+
98+
Fatal error: ERROR in %s/tests/swoole_server/addProcess_with_error.php on line %d
99+
Stack trace:
100+
#0 %s(%d): trigger_error('ERROR', 256)
101+
#1 [internal function]: Process4->{closure:Process4::run():%d}()
102+
#2 {main}
66103
DONE

tests/swoole_server/addProcess_with_tick.phpt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,36 @@ $pm->run();
5757
sleep start then sleep end
5858

5959
Fatal error: ERROR in %s/tests/swoole_server/addProcess_with_tick.php on line %d
60+
Stack trace:
61+
#0 %s(%d): trigger_error('ERROR', 256)
62+
#1 [internal function]: Process3->{closure:Process3::run():%d}(%d)
63+
#2 {main}
6064
sleep start then sleep end
6165

6266
Fatal error: ERROR in %s/tests/swoole_server/addProcess_with_tick.php on line %d
67+
Stack trace:
68+
#0 %s(%d): trigger_error('ERROR', 256)
69+
#1 [internal function]: Process3->{closure:Process3::run():%d}(%d)
70+
#2 {main}
6371
sleep start then sleep end
6472

6573
Fatal error: ERROR in %s/tests/swoole_server/addProcess_with_tick.php on line %d
74+
Stack trace:
75+
#0 %s(%d): trigger_error('ERROR', 256)
76+
#1 [internal function]: Process3->{closure:Process3::run():%d}(%d)
77+
#2 {main}
6678
sleep start then sleep end
6779

6880
Fatal error: ERROR in %s/tests/swoole_server/addProcess_with_tick.php on line %d
81+
Stack trace:
82+
#0 %s(%d): trigger_error('ERROR', 256)
83+
#1 [internal function]: Process3->{closure:Process3::run():%d}(%d)
84+
#2 {main}
6985
sleep start then sleep end
7086

7187
Fatal error: ERROR in %s/tests/swoole_server/addProcess_with_tick.php on line %d
88+
Stack trace:
89+
#0 %s(%d): trigger_error('ERROR', 256)
90+
#1 [internal function]: Process3->{closure:Process3::run():%d}(%d)
91+
#2 {main}
7292
DONE

0 commit comments

Comments
 (0)