~ubuntu-branches/ubuntu/vivid/php-apcu/vivid

« back to all changes in this revision

Viewing changes to apcu-4.0.6/tests/apc54_014.phpt

  • Committer: Package Import Robot
  • Author(s): Ondřej Surý
  • Date: 2014-06-24 10:52:52 UTC
  • mfrom: (7.1.4 sid)
  • Revision ID: package-import@ubuntu.com-20140624105252-vsqs1r4og4ykucqg
Tags: 4.0.6-1
* New upstream version 4.0.6
* Remove PHP 5.6 support patch - merged upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
APC: Bug #61742 preload_path does not work due to incorrect string length (variant 1) (php 5.4)
 
3
--SKIPIF--
 
4
<?php
 
5
    require_once(dirname(__FILE__) . '/skipif.inc'); 
 
6
    if (PHP_MAJOR_VERSION < 5 || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4)) {
 
7
                die('skip PHP 5.4+ only');
 
8
        }
 
9
        if(PHP_ZTS === 1) {
 
10
                die('skip PHP non-ZTS only');
 
11
        }
 
12
--FILE--
 
13
<?php
 
14
include "server_test.inc";
 
15
 
 
16
$file = <<<FL
 
17
\$key = 'abc';
 
18
\$b = apc_exists(\$key);
 
19
var_dump(\$b);
 
20
if (\$b) {
 
21
        \$\$key = apc_fetch(\$key);
 
22
        var_dump(\$\$key);
 
23
}
 
24
FL;
 
25
 
 
26
$args = array(
 
27
        'apc.enabled=1',
 
28
        'apc.enable_cli=1',
 
29
        'apc.preload_path=' . dirname(__FILE__) . '/data',
 
30
);
 
31
 
 
32
server_start($file, $args);
 
33
 
 
34
for ($i = 0; $i < 10; $i++) {
 
35
        run_test_simple();
 
36
}
 
37
echo 'done';
 
38
 
 
39
--EXPECT--
 
40
bool(true)
 
41
string(3) "123"
 
42
bool(true)
 
43
string(3) "123"
 
44
bool(true)
 
45
string(3) "123"
 
46
bool(true)
 
47
string(3) "123"
 
48
bool(true)
 
49
string(3) "123"
 
50
bool(true)
 
51
string(3) "123"
 
52
bool(true)
 
53
string(3) "123"
 
54
bool(true)
 
55
string(3) "123"
 
56
bool(true)
 
57
string(3) "123"
 
58
bool(true)
 
59
string(3) "123"
 
60
bool(true)
 
61
string(3) "123"
 
62
bool(true)
 
63
string(3) "123"
 
64
bool(true)
 
65
string(3) "123"
 
66
bool(true)
 
67
string(3) "123"
 
68
bool(true)
 
69
string(3) "123"
 
70
bool(true)
 
71
string(3) "123"
 
72
bool(true)
 
73
string(3) "123"
 
74
bool(true)
 
75
string(3) "123"
 
76
bool(true)
 
77
string(3) "123"
 
78
bool(true)
 
79
string(3) "123"
 
80
bool(true)
 
81
string(3) "123"
 
82
bool(true)
 
83
string(3) "123"
 
84
bool(true)
 
85
string(3) "123"
 
86
bool(true)
 
87
string(3) "123"
 
88
bool(true)
 
89
string(3) "123"
 
90
bool(true)
 
91
string(3) "123"
 
92
bool(true)
 
93
string(3) "123"
 
94
bool(true)
 
95
string(3) "123"
 
96
bool(true)
 
97
string(3) "123"
 
98
bool(true)
 
99
string(3) "123"
 
100
done