~hexmode/ubuntu/lucid/php5/php5.fix-php-bug-33210

« back to all changes in this revision

Viewing changes to ext/ldap/tests/ldap_modify_error.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2009-11-06 01:44:25 UTC
  • mfrom: (1.1.15 upstream) (0.3.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091106014425-5dsqjhbg303h3kfn
Tags: 5.2.11.dfsg.1-1ubuntu1
* Merge from debian testing, remaining changes:
  - debian/control, debian/rules: Disable a few build dependencies and
    accompanying, binary packages which we do not want to support in main:
    + firebird2-dev/php5-interbase (we have a seperate php-interbase source)
    + libc-client/php5-imap (we have a seperate php-imap source)
    + libmcrypt-dev/php5-mcrypt (seperate php-mycrpt source)
    + readline support again, now that the libedit issue is fixed.
  - debian/control: Add build dependency: libdedit-dev (>= 2.9.cvs.20050518-1)
    CLI readline support.
  - debian/rules:
    + Correctly mangle PHP5_* macros for lpia
  - debian/control:
    + Use libdb-4.6-dev.
    + Rename Vcs-Browser & Vcs-Git to XS-Original-Vcs-Browser & XS-Original-Vcs-Git (LP: #323731).
  - Dropped patches:
    - debian/patches/119-sybase-alias.patch: Use Debian's patch.
    - debian/patches/fix-autoconf-ftbfs.patch: Use Debian's patch
    - debian/patches/fix-zlib-decompression: Already in upstream
  - Use the default pear/install-pear-nozlib.phar in php 5.2.11
  - debian/control: Move php5-suhoshin to Suggests.
  - debian/rules: Fix broken symlink for pear.
  - Dropped dependency on autoconf2.13.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
ldap_modify() - Modify operations that should fail
 
3
--CREDITS--
 
4
Patrick Allaert <patrickallaert@php.net>
 
5
# Belgian PHP Testfest 2009
 
6
--SKIPIF--
 
7
<?php require_once('skipif.inc'); ?>
 
8
<?php require_once('skipifbindfailure.inc'); ?>
 
9
--FILE--
 
10
<?php
 
11
require "connect.inc";
 
12
 
 
13
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
 
14
 
 
15
// Too few parameters
 
16
var_dump(ldap_modify());
 
17
var_dump(ldap_modify($link));
 
18
var_dump(ldap_modify($link, "dc=my-domain,dc=com"));
 
19
 
 
20
// Too many parameters
 
21
var_dump(ldap_modify($link, "dc=my-domain,dc=com", array(), "Additional data"));
 
22
 
 
23
// DN not found
 
24
var_dump(ldap_modify($link, "dc=my-domain,dc=com", array()));
 
25
 
 
26
// Invalid DN
 
27
var_dump(ldap_modify($link, "weirdAttribute=val", array()));
 
28
 
 
29
$entry = array(
 
30
        "objectClass"   => array(
 
31
                "top",
 
32
                "dcObject",
 
33
                "organization"),
 
34
        "dc"                    => "my-domain",
 
35
        "o"                             => "my-domain",
 
36
);
 
37
 
 
38
ldap_add($link, "dc=my-domain,dc=com", $entry);
 
39
 
 
40
$entry2 = $entry;
 
41
$entry2["dc"] = "Wrong Domain";
 
42
 
 
43
var_dump(ldap_modify($link, "dc=my-domain,dc=com", $entry2));
 
44
 
 
45
$entry2 = $entry;
 
46
$entry2["weirdAttribute"] = "weirdVal";
 
47
 
 
48
var_dump(ldap_modify($link, "dc=my-domain,dc=com", $entry2));
 
49
?>
 
50
===DONE===
 
51
--CLEAN--
 
52
<?php
 
53
require "connect.inc";
 
54
 
 
55
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
 
56
 
 
57
ldap_delete($link, "dc=my-domain,dc=com");
 
58
?>
 
59
--EXPECTF--
 
60
Warning: Wrong parameter count for ldap_modify() in %s on line %d
 
61
NULL
 
62
 
 
63
Warning: Wrong parameter count for ldap_modify() in %s on line %d
 
64
NULL
 
65
 
 
66
Warning: Wrong parameter count for ldap_modify() in %s on line %d
 
67
NULL
 
68
 
 
69
Warning: Wrong parameter count for ldap_modify() in %s on line %d
 
70
NULL
 
71
 
 
72
Warning: ldap_modify(): Modify: No such object in %s on line %d
 
73
bool(false)
 
74
 
 
75
Warning: ldap_modify(): Modify: Invalid DN syntax in %s on line %d
 
76
bool(false)
 
77
 
 
78
Warning: ldap_modify(): Modify: Naming violation in %s on line %d
 
79
bool(false)
 
80
 
 
81
Warning: ldap_modify(): Modify: Undefined attribute type in %s on line %d
 
82
bool(false)
 
83
===DONE===