I don't understand something.
I'm creating a new set of PHPUnit tests. I need to create some hosts in DB and get their values later in the code.
So in my setUp() I have a line saying :
$mnethost->id = $DB->insert_record('mnet_host', $mnethost); // $mnethost being an object with the necessary data)
The returned value (mnet host id) is correct.
But when calling get_hosts() in a test later, in another method from antoher class, with :
$DB->get_records_sql($sql, array($CFG->mnet_localhost_id, $CFG->mnet_all_hosts_id));
it returns an empty array.
Is there something special with writing / reading DB in PHPUnit ?
And what if I would like to really write in the DB ?
(The same code in production works great)