craue / CraueConfigBundle

Database-stored settings made available via a service for your Symfony project.
MIT License
173 stars 35 forks source link

Testing locally should be easier #24

Closed stof closed 9 years ago

stof commented 9 years ago

Several things could be done to make testing easier:

craue commented 9 years ago

Regarding your 3rd point: Afaik, the only way to set a different cache path is in the AppKernel, so I'm using an uncommitted LocalAppKernel which extends the default one and defines a custom cache and log dir. I'd appreciate an easier way of configuring it, though.

craue commented 9 years ago
  1. 26 adds support to run tests with SQLite by default.

  2. I guess with that PR being merged, there's no further setup needed. Or did you encounter any other issues when trying to run the tests for the first time?
  3. The cache folder is actually ignored.
stof commented 9 years ago

@craue why not using the AppKernel of the testsuite but making use a folder in sys_get_temp_dir for its cache and logs ? this is what Symfony does in its functional tests

regarding the cache folder, my bad. I got confused by a weird behavior of the PhpStorm gitignore plugin.

craue commented 9 years ago

I want those folders (cache and log) to be created in a custom location, which is not the system temp dir, and couldn't find a different way of achieving that.

stof commented 9 years ago

Well, you can make an implementation getting the settings from $_SERVER variables by default, and falling back to the system temp dir when not set. This way, you would just need to create a phpunit.xml file locally which would set the needed variables to overwrite it.

craue commented 9 years ago

Good idea. I've added a commit to #26 for that, but using $_ENV instead as it seems to fit better.