I have inherited a system that is using chilled mode (or so I thought). It currently has two tables passed in an array:
R::freeze(['question','user']);
I am trying to freeze the whole system, one table at a time. And extending that array seems to work in most cases. It sits inside the bootstrap file of the site that all web traffic hits.
The issue is, unit tests don't respect it. Even when debugging the test, I see the test execution pass over this code, but for some reason the test will still create an absent field as if it is fluid. I tested this out a bit by freezing all and trying to add a absent field right after the freeze:
R::freeze(true);
$user = R::findOne('user');
$user->idontexist = 'blah';
R::store($user);
This results in an SQL error as expected. But if I remove that test been and let the test follow it's path to the file actually storing data for the user bean it still acts as if it's fluid, and creates `idontexist` in the table.
So what is the scope of R::freeze()? Just that request? Depends? Seems to me there is no actual global way to freeze redbean and there is execution nuance involved.