From 26dfce7f36d1c6f737ac241df1315a1b42b932c7 Mon Sep 17 00:00:00 2001 From: Fabien Villepinte Date: Fri, 15 Mar 2019 22:55:30 +0100 Subject: Replace dirname(__FILE__) by __DIR__ in tests --- ext/openssl/tests/bug28382.phpt | 2 +- ext/openssl/tests/bug37820.phpt | 2 +- ext/openssl/tests/bug39217.phpt | 2 +- ext/openssl/tests/bug41033.phpt | 4 ++-- ext/openssl/tests/bug70438.phpt | 4 ++-- ext/openssl/tests/bug71917.phpt | 4 ++-- ext/openssl/tests/bug73711.phpt | 2 +- ext/openssl/tests/bug74022.phpt | 2 +- ext/openssl/tests/openssl_csr_export_to_file_basic.phpt | 6 +++--- ext/openssl/tests/openssl_csr_get_public_key_basic.phpt | 4 ++-- ext/openssl/tests/openssl_csr_get_subject_basic.phpt | 4 ++-- ext/openssl/tests/openssl_csr_new_basic.phpt | 2 +- ext/openssl/tests/openssl_csr_sign_basic.phpt | 6 +++--- ext/openssl/tests/openssl_free_key.phpt | 2 +- ext/openssl/tests/openssl_open_basic.phpt | 4 ++-- ext/openssl/tests/openssl_pkcs12_export_basic.phpt | 6 +++--- ext/openssl/tests/openssl_pkcs12_export_to_file_basic.phpt | 10 +++++----- ext/openssl/tests/openssl_pkcs12_export_to_file_error.phpt | 10 +++++----- ext/openssl/tests/openssl_pkcs12_read_basic.phpt | 2 +- ext/openssl/tests/openssl_pkcs7_decrypt_basic.phpt | 6 +++--- ext/openssl/tests/openssl_pkcs7_encrypt_basic.phpt | 6 +++--- ext/openssl/tests/openssl_pkcs7_read_basic.phpt | 4 ++-- ext/openssl/tests/openssl_pkcs7_sign_basic.phpt | 6 +++--- ext/openssl/tests/openssl_pkcs7_verify_basic.phpt | 6 +++--- ext/openssl/tests/openssl_pkey_export_basic.phpt | 4 ++-- ext/openssl/tests/openssl_pkey_get_details_basic.phpt | 2 +- ext/openssl/tests/openssl_private_decrypt_basic.phpt | 4 ++-- ext/openssl/tests/openssl_private_encrypt_basic.phpt | 4 ++-- ext/openssl/tests/openssl_public_decrypt_basic.phpt | 4 ++-- ext/openssl/tests/openssl_public_encrypt_basic.phpt | 4 ++-- ext/openssl/tests/openssl_seal_basic.phpt | 2 +- ext/openssl/tests/openssl_sign_basic.phpt | 2 +- ext/openssl/tests/openssl_spki_export_basic.phpt | 2 +- ext/openssl/tests/openssl_spki_export_challenge_basic.phpt | 2 +- ext/openssl/tests/openssl_spki_new_basic.phpt | 2 +- ext/openssl/tests/openssl_spki_verify_basic.phpt | 2 +- ext/openssl/tests/openssl_verify_basic.phpt | 4 ++-- ext/openssl/tests/openssl_x509_check_private_key_basic.phpt | 8 ++++---- ext/openssl/tests/openssl_x509_checkpurpose_basic.phpt | 10 +++++----- ext/openssl/tests/openssl_x509_export_basic.phpt | 2 +- ext/openssl/tests/openssl_x509_export_to_file_basic.phpt | 6 +++--- ext/openssl/tests/openssl_x509_fingerprint_basic.phpt | 2 +- ext/openssl/tests/openssl_x509_free_basic.phpt | 2 +- ext/openssl/tests/openssl_x509_parse_basic.phpt | 2 +- ext/openssl/tests/openssl_x509_read_basic.phpt | 4 ++-- ext/openssl/tests/openssl_x509_verify.phpt | 10 +++++----- 46 files changed, 95 insertions(+), 95 deletions(-) (limited to 'ext/openssl') diff --git a/ext/openssl/tests/bug28382.phpt b/ext/openssl/tests/bug28382.phpt index 1ff839bf4c..f64e77dbd2 100644 --- a/ext/openssl/tests/bug28382.phpt +++ b/ext/openssl/tests/bug28382.phpt @@ -6,7 +6,7 @@ if (!extension_loaded("openssl")) die("skip"); ?> --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- OPENSSL_KEYTYPE_DSA, 'config' => $cnf])); var_dump(openssl_pkey_new(["private_key_type" => OPENSSL_KEYTYPE_DH, 'config' => $cnf])); echo "DONE"; diff --git a/ext/openssl/tests/bug74022.phpt b/ext/openssl/tests/bug74022.phpt index e3ec128fdf..1bd2116241 100644 --- a/ext/openssl/tests/bug74022.phpt +++ b/ext/openssl/tests/bug74022.phpt @@ -6,7 +6,7 @@ if (!extension_loaded("openssl")) die("skip"); ?> --FILE-- --FILE-- $config, ); -$privkey_file = 'file://' . dirname(__FILE__) . '/private_rsa_2048.key'; +$privkey_file = 'file://' . __DIR__ . '/private_rsa_2048.key'; $csr = openssl_csr_new($dn, $privkey_file, $args); var_dump(openssl_csr_export_to_file($csr, $csrfile)); var_dump(file_get_contents($csrfile)); @@ -43,7 +43,7 @@ var_dump(openssl_csr_export_to_file($csr, $csrfile, false)); ?> --CLEAN-- $config, ); -$privkey_file = 'file://' . dirname(__FILE__) . '/private_rsa_2048.key'; +$privkey_file = 'file://' . __DIR__ . '/private_rsa_2048.key'; $csr = openssl_csr_new($dn, $privkey_file, $args); -$csr_file = file_get_contents(dirname(__FILE__) . '/cert.csr'); +$csr_file = file_get_contents(__DIR__ . '/cert.csr'); var_dump(openssl_csr_get_public_key($csr)); var_dump(openssl_csr_get_public_key($csr_file)); diff --git a/ext/openssl/tests/openssl_csr_get_subject_basic.phpt b/ext/openssl/tests/openssl_csr_get_subject_basic.phpt index eba4a7ac8d..87ab824f35 100644 --- a/ext/openssl/tests/openssl_csr_get_subject_basic.phpt +++ b/ext/openssl/tests/openssl_csr_get_subject_basic.phpt @@ -32,9 +32,9 @@ $args = array( "config" => $config, ); -$privkey_file = 'file://' . dirname(__FILE__) . '/private_rsa_2048.key'; +$privkey_file = 'file://' . __DIR__ . '/private_rsa_2048.key'; $csr = openssl_csr_new($dn, $privkey_file, $args); -$csr_file = file_get_contents(dirname(__FILE__) . '/cert.csr'); +$csr_file = file_get_contents(__DIR__ . '/cert.csr'); var_dump(openssl_csr_get_subject($csr_file)); var_dump(openssl_csr_get_subject($csr, false)); diff --git a/ext/openssl/tests/openssl_csr_new_basic.phpt b/ext/openssl/tests/openssl_csr_new_basic.phpt index 816c6f9d90..83a056b061 100644 --- a/ext/openssl/tests/openssl_csr_new_basic.phpt +++ b/ext/openssl/tests/openssl_csr_new_basic.phpt @@ -10,7 +10,7 @@ var_dump(openssl_csr_new(1,$a)); var_dump(openssl_csr_new(1,$a,1,1)); $a = array(); -$conf = array('config' => dirname(__FILE__) . DIRECTORY_SEPARATOR . 'openssl.cnf'); +$conf = array('config' => __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf'); var_dump(openssl_csr_new(array(), $a, $conf, array())); // this leaks diff --git a/ext/openssl/tests/openssl_csr_sign_basic.phpt b/ext/openssl/tests/openssl_csr_sign_basic.phpt index 57c9e75c0e..969a8e1073 100644 --- a/ext/openssl/tests/openssl_csr_sign_basic.phpt +++ b/ext/openssl/tests/openssl_csr_sign_basic.phpt @@ -4,10 +4,10 @@ openssl_csr_sign() tests --FILE-- $config); diff --git a/ext/openssl/tests/openssl_free_key.phpt b/ext/openssl/tests/openssl_free_key.phpt index aa4a3a8a35..0c8bdd92de 100644 --- a/ext/openssl/tests/openssl_free_key.phpt +++ b/ext/openssl/tests/openssl_free_key.phpt @@ -21,7 +21,7 @@ for ($z = "", $i = 0; $i < 1024; $i++) { usleep($i); } -$conf = array('config' => dirname(__FILE__) . DIRECTORY_SEPARATOR . 'openssl.cnf'); +$conf = array('config' => __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf'); $privkey = openssl_pkey_new($conf); if ($privkey === false) diff --git a/ext/openssl/tests/openssl_open_basic.phpt b/ext/openssl/tests/openssl_open_basic.phpt index 55bb9eb0e3..d564bcf8e8 100644 --- a/ext/openssl/tests/openssl_open_basic.phpt +++ b/ext/openssl/tests/openssl_open_basic.phpt @@ -5,8 +5,8 @@ openssl_open() tests --FILE-- --FILE-- --FILE-- --CLEAN-- --FILE-- --CLEAN-- --FILE-- --FILE-- --FILE-- "test@test", "Subject" => "testing openssl_pkcs7_encrypt()"); $headers = array("test@test", "testing openssl_pkcs7_encrypt()"); diff --git a/ext/openssl/tests/openssl_pkcs7_read_basic.phpt b/ext/openssl/tests/openssl_pkcs7_read_basic.phpt index 64c7c2c130..ac3f1ad34f 100644 --- a/ext/openssl/tests/openssl_pkcs7_read_basic.phpt +++ b/ext/openssl/tests/openssl_pkcs7_read_basic.phpt @@ -4,8 +4,8 @@ openssl_pkcs7_read() tests --FILE-- --FILE-- "test@test", "Subject" => "testing openssl_pkcs7_sign()"); $headers = array("test@test", "testing openssl_pkcs7_sign()"); $empty_headers = array(); diff --git a/ext/openssl/tests/openssl_pkcs7_verify_basic.phpt b/ext/openssl/tests/openssl_pkcs7_verify_basic.phpt index f3572491a1..925c28b34c 100644 --- a/ext/openssl/tests/openssl_pkcs7_verify_basic.phpt +++ b/ext/openssl/tests/openssl_pkcs7_verify_basic.phpt @@ -14,10 +14,10 @@ if ($contentfile === false) { die("failed to get a temporary filename!"); } -$pkcsfile = dirname(__FILE__) . "/openssl_pkcs7_verify__pkcsfile.tmp"; +$pkcsfile = __DIR__ . "/openssl_pkcs7_verify__pkcsfile.tmp"; -$infile = dirname(__FILE__) . "/cert.crt"; -$eml = dirname(__FILE__) . "/signed.eml"; +$infile = __DIR__ . "/cert.crt"; +$eml = __DIR__ . "/signed.eml"; $wrong = "wrong"; $empty = ""; $cainfo = array(); diff --git a/ext/openssl/tests/openssl_pkey_export_basic.phpt b/ext/openssl/tests/openssl_pkey_export_basic.phpt index 4346b5a6d3..d71f8da9a3 100644 --- a/ext/openssl/tests/openssl_pkey_export_basic.phpt +++ b/ext/openssl/tests/openssl_pkey_export_basic.phpt @@ -9,7 +9,7 @@ if (!defined('OPENSSL_KEYTYPE_EC')) ?> --FILE-- __DIR__ . DIRECTORY_SEPARATOR . "openssl.cnf"); @@ -28,7 +28,7 @@ $details = openssl_pkey_get_details(openssl_pkey_get_private($output, 'passphras var_dump(OPENSSL_KEYTYPE_EC === $details['type']); // Read public key -$pKey = openssl_pkey_get_public('file://' . dirname(__FILE__) . '/public_ec.key'); +$pKey = openssl_pkey_get_public('file://' . __DIR__ . '/public_ec.key'); var_dump($pKey); // The details are the same for a public or private key, expect the private key parameter 'd $detailsPKey = openssl_pkey_get_details($pKey); diff --git a/ext/openssl/tests/openssl_pkey_get_details_basic.phpt b/ext/openssl/tests/openssl_pkey_get_details_basic.phpt index 3c239af2a2..47147436dd 100644 --- a/ext/openssl/tests/openssl_pkey_get_details_basic.phpt +++ b/ext/openssl/tests/openssl_pkey_get_details_basic.phpt @@ -7,7 +7,7 @@ if (!defined("OPENSSL_KEYTYPE_EC")) die("skip no EC available"); ?> --FILE-- diff --git a/ext/openssl/tests/openssl_private_decrypt_basic.phpt b/ext/openssl/tests/openssl_private_decrypt_basic.phpt index 76a08b8d55..c318fe89b1 100644 --- a/ext/openssl/tests/openssl_private_decrypt_basic.phpt +++ b/ext/openssl/tests/openssl_private_decrypt_basic.phpt @@ -5,8 +5,8 @@ openssl_private_decrypt() tests --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --CLEAN-- --FILE-- --FILE-- --FILE-- --FILE--