This odd dependency is causing inclusion issues to do with namespacing and
the ability to work well with the framework (according to the dependency's
readme). The usage of the tool in this case adds no value, as it's
performing purely stub type work, rather than mock work. So instead we can
use an actual stub (simply return test values depending on input) and have
everything work well.
After removing the Phockito dependency it was found that the tests that
would skip when it isn't present were actually in a failing state. So they
had to be repaired too, mostly through the use of fixing the poor code
that was causing them to fail (as opposed to being bad tests). This is
both configuration and proceedural work.
Running this command for each directory in the `src` folder we generate a
valid `.upgrade.yml` which can be used by other modules that may use this
one as a dependency to upgrade themselves without issue.
Update versions and configurations for tests and code checkers, such as
phpunit and the SilverStripe CI tools. Altered the layout of the
repository to be more in line with other SilverStripe 4 modules (including
core ones).
PHPUnit had a Functions.php with global methods like any() for a while (3.7 at least),
which clashes with similar globals from Hamcrest (used in Phockito).
Both PHPUnit and Phockito use 'classmap' composer autoloading,
but that's not directly requiring/evaluating the files.
The problem is caused by SilverStripe's ClassLoader
which does require ALL subclasses of SapphireTest.
This in turn causes PHP outside of the class context to execute,
which includes Hamcrest.
Changing the include_hamcrest() is not strictly necessary here,
but makes the code a bit more resilient against any preceding
test including Functions.php from PHPUnit.
See https://github.com/hafriedlander/phockito/issues/32 for context.
admin/externallinks/start is called, but asynchronously, so the poll()
call is never called immediately on start, you have to refresh the page
to get it to show.