Configuration for functional tests

Before writing our functional tests, we need to turn back to our phpunit.xml file and change some environment variables. Apart from the SIMPLETEST_DB variable we adjusted earlier, we also have the SIMPLETEST_BASE_URL and BROWSERTEST_OUTPUT_DIRECTORY. The first is used to know where the application can be accessed in the browser. The latter is the directory where output data can be saved by PHPUnit and needs to be an absolute local path (for example, a folder in the local files folder):

/var/www/sites/default/files/browser-output   

Moreover, make sure the user running the test has permissions to write into the sites/simpletest folder as that is where the virtual filesystem is created for each test. The easiest way to do it is to change the folder ownership to the web server user that runs the process. In the case of Apache, this is usually www-data.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset