source: src/router/php7/ext/session/tests/session_hash_function_basic.phpt @ 30549

Last change on this file since 30549 was 30549, checked in by brainslayer, 11 months ago

php 7

File size: 1.2 KB
Line 
1--TEST--
2Test session.hash_function ini setting : basic functionality
3--SKIPIF--
4<?php include('skipif.inc'); ?>
5--INI--
6session.hash_bits_per_character=4
7--FILE--
8<?php
9
10ob_start();
11
12echo "*** Testing session.hash_function : basic functionality ***\n";
13
14var_dump(ini_set('session.hash_function', 'md5'));
15var_dump(session_start());
16var_dump(!empty(session_id()), session_id());
17var_dump(session_destroy());
18
19var_dump(ini_set('session.hash_function', 'sha1'));
20var_dump(session_start());
21var_dump(!empty(session_id()), session_id());
22var_dump(session_destroy());
23
24var_dump(ini_set('session.hash_function', 'none')); // Should fail
25var_dump(session_start());
26var_dump(!empty(session_id()), session_id());
27var_dump(session_destroy());
28
29
30echo "Done";
31ob_end_flush();
32?>
33--EXPECTF--
34*** Testing session.hash_function : basic functionality ***
35string(1) "0"
36bool(true)
37bool(true)
38string(32) "%s"
39bool(true)
40string(3) "md5"
41bool(true)
42bool(true)
43string(40) "%s"
44bool(true)
45
46Warning: ini_set(): session.configuration 'session.hash_function' must be existing hash function. none does not exist. in %s%esession_hash_function_basic.php on line 17
47bool(false)
48bool(true)
49bool(true)
50string(40) "%s"
51bool(true)
52Done
Note: See TracBrowser for help on using the repository browser.