~ubuntu-branches/ubuntu/vivid/php-memcache/vivid

« back to all changes in this revision

Viewing changes to memcache-3.0.8/tests/024.phpt

  • Committer: Package Import Robot
  • Author(s): Sergey B Kirpichev
  • Date: 2013-04-19 13:23:26 UTC
  • mfrom: (1.1.8) (2.1.16 sid)
  • Revision ID: package-import@ubuntu.com-20130419132326-4o0g4jrgcrg832nd
ImportedĀ UpstreamĀ versionĀ 3.0.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
memcache->close(), memcache->get()
 
3
--SKIPIF--
 
4
<?php include 'connect.inc'; if (!isset($host2)) die('skip $host2 not set'); ?>
 
5
--FILE--
 
6
<?php
 
7
 
 
8
include 'connect.inc';
 
9
 
 
10
$memcache->addServer($host2, $port2);
 
11
$memcache->addServer($nonExistingHost, $nonExistingPort);
 
12
 
 
13
$result1 = $memcache->close();
 
14
var_dump($result1);
 
15
 
 
16
$memcache = new Memcache();
 
17
$result2 = $memcache->connect($host, $port);
 
18
$result3 = $memcache->set('test_key', 'test', false, 1);
 
19
$result4 = $memcache->close();
 
20
 
 
21
// This will fail since all servers have been removed
 
22
$result5 = $memcache->get('test_key');
 
23
 
 
24
// Reconnect server
 
25
$result6 = $memcache->connect($host, $port);
 
26
$result7 = $memcache->get('test_key');
 
27
 
 
28
var_dump($result2);
 
29
var_dump($result3);
 
30
var_dump($result4);
 
31
var_dump($result5);
 
32
var_dump($result6);
 
33
var_dump($result7);
 
34
 
 
35
?>
 
36
--EXPECT--
 
37
bool(true)
 
38
bool(true)
 
39
bool(true)
 
40
bool(true)
 
41
bool(false)
 
42
bool(true)
 
43
string(4) "test"