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;
65 parent::__construct($name);
68 global $conf, $user, $langs, $db;
69 $this->savconf = $conf;
70 $this->savuser = $user;
71 $this->savlangs = $langs;
74 print __METHOD__.
" db->type=".$db->type.
" user->id=".$user->id;
86 global $conf, $user, $langs, $db;
89 print __METHOD__.
"\n";
99 global $conf, $user, $langs, $db;
100 $conf = $this->savconf;
101 $user = $this->savuser;
102 $langs = $this->savlangs;
105 print __METHOD__.
"\n";
115 print __METHOD__.
"\n";
125 global $conf, $user, $langs, $db;
128 print __METHOD__.
"\n";
139 global $conf, $user, $langs, $db;
140 $conf = $this->savconf;
141 $user = $this->savuser;
142 $langs = $this->savlangs;
147 print __METHOD__.
" result=".$result.
"\n";
148 $this->assertTrue($result);
160 global $conf, $user, $langs, $db;
161 $conf = $this->savconf;
162 $user = $this->savuser;
163 $langs = $this->savlangs;
166 $localobject =
new MyObject($this->savdb);
167 $localobject->initAsSpecimen();
168 $result = $localobject->create($user);
170 print __METHOD__.
" result=".$result.
"\n";
171 $this->assertLessThan($result, 0);
187 global $conf, $user, $langs, $db;
188 $conf = $this->savconf;
189 $user = $this->savuser;
190 $langs = $this->savlangs;
193 $localobject =
new MyObject($this->savdb);
194 $result = $localobject->fetch($id);
195 $result = $localobject->delete($user);
197 print __METHOD__.
" id=".$id.
" result=".$result.
"\n";
198 $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.