~ubuntu-branches/ubuntu/hardy/gallery2/hardy-security

« back to all changes in this revision

Viewing changes to modules/core/test/phpunit/ItemDeleteControllerTest.class

  • Committer: Bazaar Package Importer
  • Author(s): Michael C. Schultheiss
  • Date: 2006-04-16 16:42:35 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060416164235-8uy0u4bfjdxpge2o
Tags: 2.1.1-1
* New upstream release (Closes: #362936)
  + Bugfixes for Postgres7 (Closes: #359000, #362152)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 * $RCSfile: ItemDeleteControllerTest.class,v $
4
4
 *
5
5
 * Gallery - a web based photo album viewer and editor
6
 
 * Copyright (C) 2000-2005 Bharat Mediratta
 
6
 * Copyright (C) 2000-2006 Bharat Mediratta
7
7
 *
8
8
 * This program is free software; you can redistribute it and/or modify
9
9
 * it under the terms of the GNU General Public License as published by
20
20
 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA  02110-1301, USA.
21
21
 */
22
22
/**
23
 
 * @version $Revision: 1.24 $ $Date: 2005/08/23 03:49:33 $
 
23
 * @version $Revision: 1.25 $ $Date: 2006/01/10 04:39:36 $
24
24
 * @package GalleryCore
25
25
 * @subpackage PHPUnit
26
26
 * @author Bharat Mediratta <bharat@menalto.com>
42
42
 
43
43
        /* create an album to hold all of the test items */
44
44
        list ($ret, $this->_album) = $this->_createRandomAlbum($this->_getRootId());
45
 
        if ($ret->isError()) {
 
45
        if ($ret) {
46
46
            $this->failWithStatus($ret->wrap(__FILE__, __LINE__));
47
47
        }
48
48
 
58
58
 
59
59
        /* Create a random album */
60
60
        list ($ret, $album) = $this->_createRandomAlbum($this->_album->getId());
61
 
        if ($ret->isError()) {
 
61
        if ($ret) {
62
62
            return $this->failWithStatus($ret->wrap(__FILE__, __LINE__));
63
63
        }
64
64
 
77
77
 
78
78
        /* Make sure the album is actually gone */
79
79
        $ret = $this->_verifyMissing($album->getId());
80
 
        if ($ret->isError()) {
 
80
        if ($ret) {
81
81
            return $this->failWithStatus($ret->wrap(__FILE__, __LINE__));
82
82
        }
83
83
    }
93
93
            } else {
94
94
                list($ret, $items[$i]) = $this->_createRandomDataItem($this->_album->getId());
95
95
            }
96
 
            if ($ret->isError()) {
 
96
            if ($ret) {
97
97
                return $this->failWithStatus($ret->wrap(__FILE__, __LINE__));
98
98
            }
99
99
        }
131
131
            } else {
132
132
                list($ret, $items[$i]) = $this->_createRandomDataItem($this->_album->getId());
133
133
            }
134
 
            if ($ret->isError()) {
 
134
            if ($ret) {
135
135
                return $this->failWithStatus($ret->wrap(__FILE__, __LINE__));
136
136
            }
137
137
        }
171
171
            } else {
172
172
                list($ret, $items[$i]) = $this->_createRandomDataItem($this->_album->getId());
173
173
            }
174
 
            if ($ret->isError()) {
 
174
            if ($ret) {
175
175
                return $this->failWithStatus($ret->wrap(__FILE__, __LINE__));
176
176
            }
177
177
        }
196
196
        /* make sure they're really missing */
197
197
        foreach ($items as $item) {
198
198
            $ret = $this->_verifyMissing($item->getId());
199
 
            if ($ret->isError()) {
 
199
            if ($ret) {
200
200
                return $this->failWithStatus($ret->wrap(__FILE__, __LINE__));
201
201
            }
202
202
        }
217
217
            } else {
218
218
                list($ret, $items[$i]) = $this->_createRandomDataItem($this->_album->getId());
219
219
            }
220
 
            if ($ret->isError()) {
 
220
            if ($ret) {
221
221
                return $this->failWithStatus($ret->wrap(__FILE__, __LINE__));
222
222
            }
223
223
 
224
224
            /* remove permissions for some */
225
225
            if (($i % 3) == 0) {
226
226
                $ret = GalleryCoreApi::removeItemPermissions($items[$i]->getId());
227
 
                if ($ret->isError()) {
 
227
                if ($ret) {
228
228
                    return $this->failWithStatus($ret->wrap(__FILE__, __LINE__));
229
229
                }
230
230
            }
266
266
     */
267
267
    function testDeleteBogusItem() {
268
268
        list ($ret, $bogusId) = $this->_getUnusedId();
269
 
        if ($ret->isError()) {
 
269
        if ($ret) {
270
270
            return $this->failWithStatus($ret->wrap(__FILE__, __LINE__));
271
271
        }
272
272