wmk

If you use the ORM the actual DB should be abstracted away... But then you also need to ask ORM how to sort randomly etc, as SQL might differ. But that all is Radio Eriwan... it depends

theruss

It depends on what your logic is doing of course.

theruss

@Nemanja Karadzic Food for thought, but if you're using a different RDBMS for testing than you're using in UAT/PROD, you're tests are obviously not going to be 100% representative of how your logic will run in the latter two environments

nightjarnz

@nemanja.karadzic yes, see how .travis.yml sets up tests for CI on the modules :)

wmk

you can use sqlight, but IMHO the big speed improvement isn't that much after tests switched to transactions and rollback.

Nemanja Karadzic

btw is there a way to use different database connection for testing?

wmk

yes, functional test assumes you're visiting the site as an anonymous user, unless you log in

Nemanja Karadzic

but if you extend FunctionalTest - then no user is logged in because https://github.com/silverstripe/silverstripe-framework/blob/4/src/Dev/FunctionalTest.php#L101

Show 1 attachment(s)
GitHub  
silverstripe/silverstripe-framework

SilverStripe Framework, the MVC framework that powers SilverStripe CMS - silverstripe/silverstripe-framework

Hide attachment content