Skip to content

Commit fe3a5f8

Browse files
committed
Fix tests
1 parent 4662202 commit fe3a5f8

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

tests/swoole_client_sync/eof.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ $pm->parentFunc = function ($pid) use ($port) {
3434
for ($i = 0; $i < 1000; $i++) {
3535
$pkg = $client->recv();
3636
Assert::assert($pkg != false);
37-
$_pkg = unserialize($pkg);
37+
$_pkg = swoole_substr_unserialize($pkg, 0, strlen($pkg) - 4);
3838
Assert::assert(is_array($_pkg));
3939
Assert::same($_pkg['i'], $i);
4040
Assert::assert(strlen($_pkg['data']) > 8192 and strlen($_pkg['data']) <= 256 * 1024);

tests/swoole_client_sync/eof_close.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ $pm->parentFunc = function ($pid) use ($port, $pkg, $pm) {
2424
$client->send("recv\r\n\r\n");
2525
$recvPkg = $client->recv();
2626
Assert::assert($recvPkg != false);
27-
$_pkg = unserialize($recvPkg);
27+
$_pkg = swoole_substr_unserialize($recvPkg, 0, strlen($recvPkg) - 4);
2828
Assert::assert(is_array($_pkg));
2929
Assert::eq($_pkg['data'], $pkg);
3030
$recvPkg = $client->recv();

tests/swoole_function/substr_unserialize.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ $a['int'] = rand(1, 999999);
1212
$a['list'] = ['a,', 'b', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'];
1313

1414
$val = serialize($a);
15-
$str = pack('N', strlen($val)).$val."\r\n";
15+
$str = pack('N', strlen($val)) . $val . "\r\n";
1616

1717
$l = strlen($str) - 6;
1818
Assert::eq(swoole_substr_unserialize($str, 4, $l), $a);
19-
Assert::eq(swoole_substr_unserialize($str, 4), $a);
19+
Assert::eq(@swoole_substr_unserialize($str, 4), $a);
2020
Assert::eq(@swoole_substr_unserialize($str, 0), false);
2121
Assert::eq(@swoole_substr_unserialize($str, 6), false);
2222
Assert::eq(@swoole_substr_unserialize($str, 4, $l - 4), false);

tests/swoole_pdo_oracle/bug44301.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ run(function() {
2929
?>
3030
--EXPECTF--
3131
SQLSTATE[HY000]: General error: 942 OCIStmtExecute: ORA-00942: table or view does not exist
32-
Help: %s
32+
Help: %s
3333
(%s:%d)"

tests/swoole_pdo_oracle/bug_33707.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ array(3) {
3131
int(942)
3232
[2]=>
3333
string(%d) "OCIStmtExecute: ORA-00942: table or view does not exist
34-
Help: %s
34+
Help: %s
3535
(%s:%d)"
3636
}

tests/swoole_pdo_oracle/pdo_oci_attr_autocommit_2.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ Test 1 Check beginTransaction insertion
110110
Test 2 Cause an exception and test beginTransaction rollback
111111
Caught expected exception at line %d
112112
SQLSTATE[HY000]: General error: 12899 OCIStmtExecute: ORA-12899: %s
113-
Help: %s
114-
(%s:%d)"
113+
Help: %s
114+
(%s:%d)
115115
Test 3 Setting ATTR_AUTOCOMMIT to true will commit and end the transaction
116116
PDO::ATTR_AUTOCOMMIT: bool(true)
117117
Caught expected exception at line %d

0 commit comments

Comments
 (0)