silverstripe / cwp-core

CWP basic compatibility module
BSD 3-Clause "New" or "Revised" License
3 stars 12 forks source link

MNT Update unit test #123

Closed emteknetnz closed 1 year ago

emteknetnz commented 1 year ago

Issue https://github.com/silverstripe/.github/issues/34

Fixes https://github.com/silverstripe/cwp-core/actions/runs/4559370105/jobs/8043562334#step:12:69

1) CWP\Core\Tests\PasswordStrengthTest::testPasswordMinLength Error: Call to a member function getMinLength() on null

Issue came about because of this PR https://github.com/silverstripe/recipe-core/pull/86.

I think there's a weird code-path for how the PasswordValidator normally gets registered in the CMS which I wasn't able to quickly find via a debug, though I've manually confirmed again that it does work so no issue there. It's just whatever code path that is taken in the CMS isn't also taken by unit-tests

GuySartorelli commented 1 year ago

I don't feel comfortable merging this without understanding why the thing wasn't being injected for this test - as it may indicate there's some edge case where it won't be available for projects as well.

emteknetnz commented 1 year ago

I think it wasn't being injected because of the code that was in recipe-core that got added to app/_config.php on composer create-project