25 global $conf, $user, $langs, $db;
28 require_once dirname(__FILE__).
'/../../htdocs/master.inc.php';
29 require_once dirname(__FILE__).
'/../../htdocs/mymodule/class/myobject.class.php';
31 if (empty($user->id)) {
32 print "Load permissions for admin user nb 1\n";
36 $conf->global->MAIN_DISABLE_ALL_MAILS = 1;
60 parent::__construct();
63 global $conf, $user, $langs, $db;
64 $this->savconf = $conf;
65 $this->savuser = $user;
66 $this->savlangs = $langs;
69 print __METHOD__.
" db->type=".$db->type.
" user->id=".$user->id;
80 global $conf, $user, $langs, $db;
83 print __METHOD__.
"\n";
92 global $conf, $user, $langs, $db;
93 $conf = $this->savconf;
94 $user = $this->savuser;
95 $langs = $this->savlangs;
98 print __METHOD__.
"\n";
107 print __METHOD__.
"\n";
116 global $conf, $user, $langs, $db;
119 print __METHOD__.
"\n";
130 global $conf, $user, $langs, $db;
131 $conf = $this->savconf;
132 $user = $this->savuser;
133 $langs = $this->savlangs;
138 print __METHOD__.
" result=".$result.
"\n";
139 $this->assertTrue($result);
151 global $conf, $user, $langs, $db;
152 $conf = $this->savconf;
153 $user = $this->savuser;
154 $langs = $this->savlangs;
157 $localobject =
new MyObject($this->savdb);
158 $localobject->initAsSpecimen();
159 $result = $localobject->create($user);
161 print __METHOD__.
" result=".$result.
"\n";
162 $this->assertLessThan($result, 0);
178 global $conf, $user, $langs, $db;
179 $conf = $this->savconf;
180 $user = $this->savuser;
181 $langs = $this->savlangs;
184 $localobject =
new MyObject($this->savdb);
185 $result = $localobject->fetch($id);
186 $result = $localobject->delete($user);
188 print __METHOD__.
" id=".$id.
" result=".$result.
"\n";
189 $this->assertLessThan($result, 0);
tearDown()
Unit test teardown.
__construct()
Constructor We save global variables into local variables.
testMyObjectDelete($id)
testMyObjectDelete
testSomething()
A sample test.
static tearDownAfterClass()
Global test teardown.
print
Draft customers invoices.
testMyObjectCreate()
testMyObjectCreate
static setUpBeforeClass()
Global test setup.