Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Data Model Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Unit Tests and Model Building


Go to End


4 Posts   752 Views

Avatar
mikelbring

Community Member, 2 Posts

22 March 2012 at 10:16am

I renamed a model file and do a `/dev/build/?flush=all` and it works fine for the live site, however my unit tests still want to load the old model file, although I am not using this model anywhere on the live site or in my unit tests. Do I need to run a separate build for unit tests? I cannot find anything regarding this.

Avatar
Willr

Forum Moderator, 5523 Posts

22 March 2012 at 6:47pm

Are you running the tests via cli? If so then you need to also flush that. SilverStripe mantains 2 caches, a web cache and a cli one. So you if you a flush=all in a webbrowser it doesn't clear the cli version.

Via sake you can do sake dev/tests/all flush=all

Avatar
mikelbring

Community Member, 2 Posts

23 March 2012 at 2:33am

I am actually running the tests in my browser, so is there a flush that I need to do for the tests via the browser besides `/dev/build/?flush=all` ?

Avatar
Willr

Forum Moderator, 5523 Posts

23 March 2012 at 7:29pm

You could try the ?flush with your test runner - dev/tests/all?flush=all. If that doesn't work I'd double check you aren't referencing that code anywhere. What's the error message?