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

« back to all changes in this revision

Viewing changes to modules/core/test/phpunit/ItemDeleteSingleControllerTest.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: ItemDeleteSingleControllerTest.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.7 $ $Date: 2005/08/23 03:49:33 $
 
23
 * @version $Revision: 1.8 $ $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
 
57
57
 
58
58
        /* Create a random sub album */
59
59
        list ($ret, $album) = $this->_createRandomAlbum($this->_album->getId());
60
 
        if ($ret->isError()) {
 
60
        if ($ret) {
61
61
            return $this->failWithStatus($ret->wrap(__FILE__, __LINE__));
62
62
        }
63
63
 
76
76
 
77
77
        /* Make sure the album is actually gone */
78
78
        $this->_verifyMissing($album->getId());
79
 
        if ($ret->isError()) {
 
79
        if ($ret) {
80
80
            return $this->failWithStatus($ret->wrap(__FILE__, __LINE__));
81
81
        }
82
82
    }
88
88
        global $gallery;
89
89
 
90
90
        list($ret, $item) = $this->_createRandomDataItem($this->_album->getId());
91
 
        if ($ret->isError()) {
 
91
        if ($ret) {
92
92
            return $this->failWithStatus($ret->wrap(__FILE__, __LINE__));
93
93
        }
94
94
 
95
95
        $ret = GalleryCoreApi::removeItemPermissions($item->getId());
96
 
        if ($ret->isError()) {
 
96
        if ($ret) {
97
97
            return $this->failWithStatus($ret->wrap(__FILE__, __LINE__));
98
98
        }
99
99
 
105
105
 
106
106
        /* make sure it's still there */
107
107
        list ($ret, $item) = $item->refresh();
108
 
        if ($ret->isError()) {
 
108
        if ($ret) {
109
109
            return $this->failWithStatus($ret->wrap(__FILE__, __LINE__));
110
110
        }
111
111
    }