1--TEST--
2Sybase-CT application name
3--SKIPIF--
4<?php require('skipif.inc'); ?>
5--FILE--
6<?php
7/* This file is part of PHP test framework for ext/sybase_ct
8 *
9 * $Id$
10 */
11
12  require('test.inc');
13
14  // {{{ bool compare_string(string expect, string actual)
15  //     Compares expect to a trimmed version of actual
16  function compare_string($expect, $actual) {
17    $trimmed= rtrim($actual, ' ');
18    return (0 == strncmp($expect, $trimmed, strlen($trimmed)));
19  }
20  // }}}
21
22  $program_name= 'phpt_test';
23  $hostname= 'php.net';
24  ini_set('sybct.hostname', $hostname);
25
26  $db= sybase_connect_ex(NULL, $program_name);
27  $r= sybase_select_ex($db, '
28    select
29      hostname,
30      program_name
31    from
32      master..sysprocesses
33    where
34      program_name = "'.$program_name.'"'
35  );
36
37  var_dump(
38    compare_string($program_name, $r[0]['program_name']),
39    compare_string($hostname, $r[0]['hostname'])
40  );
41
42  sybase_close($db);
43?>
44--EXPECTF--
45>>> Query:
46    select
47      hostname,
48      program_name
49    from
50      master..sysprocesses
51    where
52      program_name = "phpt_test"
53<<< Return: resource
54bool(true)
55bool(true)
56