-
Notifications
You must be signed in to change notification settings - Fork 7.8k
/
Copy pathtest_appname.phpt
55 lines (49 loc) · 1.11 KB
/
test_appname.phpt
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
--TEST--
Sybase-CT application name
--SKIPIF--
<?php require('skipif.inc'); ?>
--FILE--
<?php
/* This file is part of PHP test framework for ext/sybase_ct
*
* $Id$
*/
require('test.inc');
// {{{ bool compare_string(string expect, string actual)
// Compares expect to a trimmed version of actual
function compare_string($expect, $actual) {
$trimmed= rtrim($actual, ' ');
return (0 == strncmp($expect, $trimmed, strlen($trimmed)));
}
// }}}
$program_name= 'phpt_test';
$hostname= 'php.net';
ini_set('sybct.hostname', $hostname);
$db= sybase_connect_ex(NULL, $program_name);
$r= sybase_select_ex($db, '
select
hostname,
program_name
from
master..sysprocesses
where
program_name = "'.$program_name.'"'
);
var_dump(
compare_string($program_name, $r[0]['program_name']),
compare_string($hostname, $r[0]['hostname'])
);
sybase_close($db);
?>
--EXPECTF--
>>> Query:
select
hostname,
program_name
from
master..sysprocesses
where
program_name = "phpt_test"
<<< Return: resource
bool(true)
bool(true)