26global
$conf, $user, $langs, $db;
30require_once dirname(__FILE__).
'/../../htdocs/master.inc.php';
31require_once dirname(__FILE__).
'/../../htdocs/mymodule/class/myobject.class.php';
33if (empty($user->id)) {
34 print
"Load permissions for admin user nb 1\n";
38$conf->global->MAIN_DISABLE_ALL_MAILS = 1;
78 parent::__construct($name);
81 global
$conf, $user, $langs, $db;
82 $this->savconf =
$conf;
83 $this->savuser = $user;
84 $this->savlangs = $langs;
87 print __METHOD__.
" db->type=".$db->type.
" user->id=".$user->id;
99 global
$conf, $user, $langs, $db;
102 print __METHOD__.
"\n";
112 global
$conf, $user, $langs, $db;
113 $conf = $this->savconf;
114 $user = $this->savuser;
115 $langs = $this->savlangs;
118 print __METHOD__.
"\n";
128 print __METHOD__.
"\n";
138 global
$conf, $user, $langs, $db;
141 print __METHOD__.
"\n";
153 global
$conf, $user, $langs, $db;
154 $conf = $this->savconf;
155 $user = $this->savuser;
156 $langs = $this->savlangs;
161 print __METHOD__.
" result=".((int) $result).
"\n";
162 $this->assertTrue($result);
175 global
$conf, $user, $langs, $db;
176 $conf = $this->savconf;
177 $user = $this->savuser;
178 $langs = $this->savlangs;
181 $localobject =
new MyObject($this->savdb);
182 $localobject->initAsSpecimen();
183 $result = $localobject->create($user);
185 print __METHOD__.
" result=".$result.
"\n";
186 $this->assertLessThan($result, 0);
203 global
$conf, $user, $langs, $db;
204 $conf = $this->savconf;
205 $user = $this->savuser;
206 $langs = $this->savlangs;
209 $localobject =
new MyObject($this->savdb);
210 $result = $localobject->fetch(
$id);
211 $result = $localobject->delete($user);
213 print __METHOD__.
" id=".
$id.
" result=".$result.
"\n";
214 $this->assertLessThan($result, 0);
__construct($name='')
Constructor We save global variables into local variables.
testMyObjectCreate()
testMyObjectCreate
static tearDownAfterClass()
Global test teardown.
static setUpBeforeClass()
Global test setup.
testMyObjectDelete($id)
testMyObjectDelete
tearDown()
Unit test teardown.
testSomething()
A sample test.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...