Fix the test error handler to fail from PHP errors.

Previously, it was asserting that the error code was non-zero, which
would always be true, and was thus ignoring all the warnings.

Change-Id: I97f21348c5d66a8e53bac90a938821ce734a966a
Improve logging of PHP errors.

Include the file and line number so that we can easily see where
the error actually is.

Change-Id: I277431720a9e0a2eb96c3732ca59b24497c895a0
Ensure that tests which authenticate have a valid key file.

Otherwise we get a (quite valid) warning that the file can't be read
if you've also used the IDE via apache on the same machine (as the
apache user will have created 600 the default key file).

Change-Id: If0c556dce34fab131d7018c6ca3b6b07953d3f3f
Pass the right arguments when testing project copying.

Previously this portion of the test wasn't actually testing what it
was intending to, as it wasn't actually passing the team to operate
on.

Change-Id: I79f700636f7961f38c170fe15a3a186060c52c0f
Avoid warnings about uninitialised variables in Team Status.

These otherwise fill up the logs on badger, potentially obscuring
more serious issues.

Change-Id: Ibd86f1dde4ab5020b1b4d4e31e8c1b47340f998f
Clarify behaviour instead of hiding missing key error.

Change-Id: I9bbedb857d8e02bae0c7b2a7bdd206241f29cb14
Avoid warning in tests that the path being removed doesn't exist.

This function is used to ensure a clean state, not to check that
the previous state is as expected, so erroring about a missing path
is just a distraction here.

Change-Id: I24ee22b37fef99c3cb10175f31b552e32ae0bfc3
Fix warnings in admin tests.

Add missing parameter to TeamStatus::save, cleanCreate rather than
plain mkdir the folder that contains the image to ensure it's empty.

Change-Id: I6b40e84082253a71a4d4f5cf98eea9416a5791ea
Replace dynamic folder with a more explicit mechanism.

Also determine the expected subdir in a better manner (it appears
dirname('foo') returns '.', which is nice).

Change-Id: Ie2d1ab76d5c843d4808281ed49774b265f58c56c
Additional debug prints.

Change-Id: Ie54355b06d7a5dad82c4fdf196aa912fb74fec87
Change from comments to section()s, for easier debugging.

section()s print to the output which nicely delimit it.

Change-Id: I20f1713e62764ac618acdc7c5c5ad3d31be91faf
Add a helper for determining if a folder exists.

Change-Id: I9a89c2c0440b7b5eee482fe981b0be8b7387a428
Don't store time & content for folders when updating repos.

This is very redundant, and leads to trying to write the data back
to the folder after the update has happened, which isn't a valid
thing to be doing (and emitted warnings).

Change-Id: Iecb9383464863cf6f1b9ced09f7ff602f5c3281d
Improve assertions, replace untested deletions by assertions.

Change-Id: Icd27c0121bbf446f4e273a8168bf0ef947a32607
Ensure the repo to be deleted exists.

Without this, the test is pretty pointless.

Change-Id: I44838019f33ecbf0abe6926c4591d19966ec99b4
Avoid scanning a non-existent directory.

It's redundant, and generates an avoidable warning.

Change-Id: I2e17af403956f5d143077f80ac4595f42d990e03
Modify signture to match behaviour.

Since both all of the arguments are tested for null, there seems
little point in requiring them to be present.

Change-Id: I50bbe546ad585b458c02547cf3d9780cd2368b10
Update several test overriding of the modules to load.

It appears that these tests were missed when the lazy-load support
was merged (probably because it was merged substantially later than
it was finished). The 'modules' key is no longer used, and is effectively
replaced by 'modules.always'.

Change-Id: If5192635f99f15c948512afc2c1b37e6c40bf5cd
Also ensure the proj/cron test has a valid key file.

This would ideally have been included in 941bbeb59e8925ef202, but
it's non-obvious that this test also needs a key file, since it
doesn't explicitly do an auth check. However, as the project module
always does a check, it does need it.

Change-Id: I73e4213d42345a44163d048f27f0b88fa3edb688
Prevent a PHP warning failing a failure-mode test.

This test specifically creates a failure-mode case that is expected
to produce a PHP error, and then tests that the dispatch has handled
this correctly. Thus, remove the test-failing handler for the dispatch
and then restore it afterwards.

Change-Id: I25d0d952f1c9cfb0455ca703c6b547797fea1e3a