1--TEST--
2Regression test for bug #8735
3--FILE--
4<?php
5set_include_path(dirname(dirname(__FILE__)) . ':' . get_include_path());
6$datasrc = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'bug8735.passwd';
7
8require_once 'PEAR.php';
9require_once 'Auth.php';
10
11$a = new Auth('File',
12		array('file' => $datasrc,
13			'type' => 'AuthBasic'),
14		'displayLogin');
15if (PEAR::isError($a)) {
16	print $a->getMessage();
17	exit;
18}
19
20$error = $a->removeUser('username');
21if (PEAR::isError($error)) {
22	print $error->getMessage();
23	exit;
24}
25
26readfile($datasrc);
27print "-- cut --\n";
28
29$error = $a->addUser('username', 'password');
30if (PEAR::isError($error) || $error === false) {
31	print "Error happened when adding.\n";
32	print $error->getMessage();
33	exit;
34}
35
36readfile($datasrc);
37
38$a->removeUser('username');
39?>
40--EXPECT--
41test:fcfKBtvEwG4g.
42-- cut --
43test:fcfKBtvEwG4g.
44username:{SHA}W6ph5Mm5Pz8GgiULbPgzG37mj9g=
45