DB ACL Data Source in CakePHP 1.3

When doing the integration testing, we always want to use the test database. However, it is a little bit difficult with CakePHP when DB ACL is enabled in your application.

CakePHP try to be smart. It tries to create separate tables (prefixed with test_suite_) when we have our fixtures set up. However, DB ACL uses separate settings in Configure class:
Configure::read('Acl.database');

So when we do testing, we need to have an extra line in our setup before we run any test.
Configure::write('Acl.database', 'test_database');

Fixture setting may be needed as well.

Leave a Reply

Your email address will not be published. Required fields are marked *