summaryrefslogtreecommitdiff
path: root/ext/readline/tests/readline_read_history_001.phpt
blob: 8fbcaf1a27722f044891f30ebb953f7ab8f8028b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
--TEST--
readline_read_history(): Basic test
--SKIPIF--
<?php
if (!extension_loaded("readline") || !function_exists('readline_list_history')) die("skip");
if (getenv('SKIP_REPEAT')) die("skip readline has global state");
?>
--FILE--
<?php

$name = tempnam(sys_get_temp_dir(), 'readline.tmp');

readline_add_history("foo");

var_dump(readline_write_history($name));

var_dump(readline_clear_history());

var_dump(readline_read_history($name));

var_dump(readline_list_history());

unlink($name);

?>
--EXPECT--
bool(true)
bool(true)
bool(true)
array(1) {
  [0]=>
  string(3) "foo"
}