Message of the day:
Making TDD easy in SilverStripe
Discuss testing in SilverStripe
Yep, taking the direct path seems to be the way to go. @blueo your suggestion came in very handy, thank you.
I'll give it a go @firesphere, thanks! I appreciate the direction
You're better off, for your tests, to do this call with a set of authenticators as per @blueo’s suggestion. Testing if your authenticator has become the default is not your job, that's the job of the framework itself
You're trying to test if your custom action is hit,
Security/login/myaction will attempt to look for the
myaction Authenticator, as the actual login request goes through
That still sounds as I said above, testing the framework instead of your custom code
The test I'm working at now (not the one in the example above) is calling
$this->get('Security/login/myaction'), so expecting a specific default authenticator with the available action (to cover the action method)
What are you trying to cover with your test? As I said before,you're basically testing default framework functionality, so I'm not sure what the added value is for your goal?
But yeah, assigning the specific authenticator on the fly for (
FunctionalTest) testing is proving a challenge
You could make one and open-source it 😄