25 global $conf, $user, $langs, $db;
29 require_once dirname(__FILE__).
'/../../htdocs/master.inc.php';
30 require_once dirname(__FILE__).
'/../../htdocs/mymodule/class/myobject.class.php';
32 if (empty($user->id)) {
33 print
"Load permissions for admin user nb 1\n";
37 $conf->global->MAIN_DISABLE_ALL_MAILS = 1;
64 parent::__construct();
67 global $conf, $user, $langs, $db;
68 $this->savconf = $conf;
69 $this->savuser = $user;
70 $this->savlangs = $langs;
73 print __METHOD__.
" db->type=".$db->type.
" user->id=".$user->id;
85 global $conf, $user, $langs, $db;
88 print __METHOD__.
"\n";
98 global $conf, $user, $langs, $db;
99 $conf = $this->savconf;
100 $user = $this->savuser;
101 $langs = $this->savlangs;
104 print __METHOD__.
"\n";
114 print __METHOD__.
"\n";
124 global $conf, $user, $langs, $db;
127 print __METHOD__.
"\n";
138 global $conf, $user, $langs, $db;
139 $conf = $this->savconf;
140 $user = $this->savuser;
141 $langs = $this->savlangs;
146 print __METHOD__.
" result=".$result.
"\n";
147 $this->assertTrue($result);
159 global $conf, $user, $langs, $db;
160 $conf = $this->savconf;
161 $user = $this->savuser;
162 $langs = $this->savlangs;
165 $localobject =
new MyObject($this->savdb);
166 $localobject->initAsSpecimen();
167 $result = $localobject->create($user);
169 print __METHOD__.
" result=".$result.
"\n";
170 $this->assertLessThan($result, 0);
186 global $conf, $user, $langs, $db;
187 $conf = $this->savconf;
188 $user = $this->savuser;
189 $langs = $this->savlangs;
192 $localobject =
new MyObject($this->savdb);
193 $result = $localobject->fetch($id);
194 $result = $localobject->delete($user);
196 print __METHOD__.
" id=".$id.
" result=".$result.
"\n";
197 $this->assertLessThan($result, 0);
testMyObjectCreate()
testMyObjectCreate
static tearDownAfterClass()
Global test teardown.
static setUpBeforeClass()
Global test setup.
testMyObjectDelete($id)
testMyObjectDelete
tearDown()
Unit test teardown.
testSomething()
A sample test.
__construct()
Constructor We save global variables into local variables.