I'm trying to mock out an object with a specific ENTERED_DT in my test like so:
$partTopic = new PartTopic();
$partTopic->PARTICIPANT_ID = 123;
$partTopic->TOPIC_ID = 5;
$partTopic->ENTERED_DT = new Expression("TRUNC(TO_DATE('20160101', 'YYYYMMDD'))");
$partTopic->save();
The ENTERED_DT is normally done via an Oracle trigger. I can test that the object is created using seeRecord or print it out to the console which is returns:
However when I unit test a query that then uses a between statement to find this record I always get 0 records returned. If I manually create this object in the DB it works though, so I guess is what I'm trying to do possible or am I missing something with this approach?
Hi
I'm trying to mock out an object with a specific
ENTERED_DT
in my test like so:The
ENTERED_DT
is normally done via an Oracle trigger. I can test that the object is created usingseeRecord
or print it out to the console which is returns:However when I unit test a query that then uses a between statement to find this record I always get 0 records returned. If I manually create this object in the DB it works though, so I guess is what I'm trying to do possible or am I missing something with this approach?