Skip to content

Commit 544f5ad

Browse files
committed
Fix mcrypt_ecb tests after deprecation
1 parent baea290 commit 544f5ad

9 files changed

+28
-6
lines changed

ext/mcrypt/tests/mcrypt_ecb.phpt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,10 @@ echo trim(mcrypt_ecb($cipher, $key, $enc_data, MCRYPT_DECRYPT, $iv)) . "\n";
1818
mcrypt_ecb($cipher, $key, $enc_data, MCRYPT_DECRYPT);
1919

2020
--EXPECTF--
21+
22+
Deprecated: Function mcrypt_ecb() is deprecated in %s on line %d
23+
24+
Deprecated: Function mcrypt_ecb() is deprecated in %s on line %d
2125
PHP Testfest 2008
26+
27+
Deprecated: Function mcrypt_ecb() is deprecated in %s on line %d

ext/mcrypt/tests/mcrypt_ecb_3des_decrypt.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ if (!extension_loaded("mcrypt")) {
88
?>
99
--FILE--
1010
<?php
11+
error_reporting(E_ALL & ~E_DEPRECATED);
12+
1113
/* Prototype : string mcrypt_ecb(int cipher, string key, string data, int mode, string iv)
1214
* Description: ECB crypt/decrypt data using key key with cipher cipher starting with iv
1315
* Source code: ext/mcrypt/mcrypt.c
@@ -94,4 +96,4 @@ string(32) "736563726574206d6573736167650000"
9496

9597
iv length=9
9698
string(32) "736563726574206d6573736167650000"
97-
===DONE===
99+
===DONE===

ext/mcrypt/tests/mcrypt_ecb_3des_encrypt.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ if (!extension_loaded("mcrypt")) {
88
?>
99
--FILE--
1010
<?php
11+
error_reporting(E_ALL & ~E_DEPRECATED);
12+
1113
/* Prototype : string mcrypt_ecb(int cipher, string key, string data, int mode, string iv)
1214
* Description: ECB crypt/decrypt data using key key with cipher cipher starting with iv
1315
* Source code: ext/mcrypt/mcrypt.c

ext/mcrypt/tests/mcrypt_ecb_error.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ if (!extension_loaded("mcrypt")) {
88
?>
99
--FILE--
1010
<?php
11+
error_reporting(E_ALL & ~E_DEPRECATED);
12+
1113
/* Prototype : string mcrypt_ecb(int cipher, string key, string data, int mode, string iv)
1214
* Description: ECB crypt/decrypt data using key key with cipher cipher starting with iv
1315
* Source code: ext/mcrypt/mcrypt.c

ext/mcrypt/tests/mcrypt_ecb_variation1.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ if (!extension_loaded("mcrypt")) {
88
?>
99
--FILE--
1010
<?php
11+
error_reporting(E_ALL & ~E_DEPRECATED);
12+
1113
/* Prototype : string mcrypt_ecb(string cipher, string key, string data, int mode, string iv)
1214
* Description: ECB crypt/decrypt data using key key with cipher cipher starting with iv
1315
* Source code: ext/mcrypt/mcrypt.c
@@ -18,7 +20,7 @@ echo "*** Testing mcrypt_ecb() : usage variation ***\n";
1820

1921
// Define error handler
2022
function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
21-
if (error_reporting() != 0) {
23+
if ($err_no & error_reporting()) {
2224
// report non-silenced errors
2325
echo "Error: $err_no - $err_msg, $filename($linenum)\n";
2426
}

ext/mcrypt/tests/mcrypt_ecb_variation2.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ if (!extension_loaded("mcrypt")) {
88
?>
99
--FILE--
1010
<?php
11+
error_reporting(E_ALL & ~E_DEPRECATED);
12+
1113
/* Prototype : string mcrypt_ecb(string cipher, string key, string data, int mode, string iv)
1214
* Description: ECB crypt/decrypt data using key key with cipher cipher starting with iv
1315
* Source code: ext/mcrypt/mcrypt.c
@@ -18,7 +20,7 @@ echo "*** Testing mcrypt_ecb() : usage variation ***\n";
1820

1921
// Define error handler
2022
function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
21-
if (error_reporting() != 0) {
23+
if ($err_no & error_reporting()) {
2224
// report non-silenced errors
2325
echo "Error: $err_no - $err_msg, $filename($linenum)\n";
2426
}

ext/mcrypt/tests/mcrypt_ecb_variation3.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ if (!extension_loaded("mcrypt")) {
88
?>
99
--FILE--
1010
<?php
11+
error_reporting(E_ALL & ~E_DEPRECATED);
12+
1113
/* Prototype : string mcrypt_ecb(string cipher, string key, string data, int mode, string iv)
1214
* Description: ECB crypt/decrypt data using key key with cipher cipher starting with iv
1315
* Source code: ext/mcrypt/mcrypt.c
@@ -18,7 +20,7 @@ echo "*** Testing mcrypt_ecb() : usage variation ***\n";
1820

1921
// Define error handler
2022
function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
21-
if (error_reporting() != 0) {
23+
if ($err_no & error_reporting()) {
2224
// report non-silenced errors
2325
echo "Error: $err_no - $err_msg, $filename($linenum)\n";
2426
}

ext/mcrypt/tests/mcrypt_ecb_variation4.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ if (!extension_loaded("mcrypt")) {
88
?>
99
--FILE--
1010
<?php
11+
error_reporting(E_ALL & ~E_DEPRECATED);
12+
1113
/* Prototype : string mcrypt_ecb(string cipher, string key, string data, int mode, string iv)
1214
* Description: ECB crypt/decrypt data using key key with cipher cipher starting with iv
1315
* Source code: ext/mcrypt/mcrypt.c
@@ -18,7 +20,7 @@ echo "*** Testing mcrypt_ecb() : usage variation ***\n";
1820

1921
// Define error handler
2022
function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
21-
if (error_reporting() != 0) {
23+
if ($err_no & error_reporting()) {
2224
// report non-silenced errors
2325
echo "Error: $err_no - $err_msg, $filename($linenum)\n";
2426
}

ext/mcrypt/tests/mcrypt_ecb_variation5.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ if (!extension_loaded("mcrypt")) {
88
?>
99
--FILE--
1010
<?php
11+
error_reporting(E_ALL & ~E_DEPRECATED);
12+
1113
/* Prototype : string mcrypt_ecb(string cipher, string key, string data, int mode, string iv)
1214
* Description: ECB crypt/decrypt data using key key with cipher cipher starting with iv
1315
* Source code: ext/mcrypt/mcrypt.c
@@ -18,7 +20,7 @@ echo "*** Testing mcrypt_ecb() : usage variation ***\n";
1820

1921
// Define error handler
2022
function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
21-
if (error_reporting() != 0) {
23+
if ($err_no & error_reporting()) {
2224
// report non-silenced errors
2325
echo "Error: $err_no - $err_msg, $filename($linenum)\n";
2426
}

0 commit comments

Comments
 (0)