[3.0] Removes SMF\Lang's dependency on the database - #9581
Conversation
Previously, trying to load any language strings required the theme to be loaded, which in turn required the database to be loaded. Now we simply skip the theme stuff if the database is not available. Signed-off-by: Jon Stovell <jonstovell@gmail.com>
|
@albertlast, this should make it possible to write unit tests for Testing some of the methods in |
|
Confirmed — I checked this by running both versions against On On this branch every public method on the class works, and One scope note for anyone reading later: most of Worth saying how I see the two halves fitting together. For code where a database genuinely cannot be avoided, #9347 (on top of #9345) extends the test system with an integration suite that drives a real installed forum, so that side gets covered rather than staying untestable. But a test that needs no database is far cheaper — the unit suite finishes in under a second, runs on every pull request on 8.4 and 8.5, and needs no Docker and no forum behind it. For a class like Checked for fallout as well, all clean: full suite green; the install and upgrade path byte-identical, since under I have put the tests up as #9582, on top of this branch — a Three things I would raise. 1.
It only bites a forum whose theme ships a 2.
Latent today, since nothing calls 3. The strongest argument for this PR may not be the tests.
|
Signed-off-by: Jon Stovell <jonstovell@gmail.com>
Signed-off-by: Jon Stovell <jonstovell@gmail.com>
Fixed in df4b8dc
Fixed in c266fd0
Hm. Yes, that is an added benefit. If I remember correctly, there are also a number of other places where we currently use hard-coded English strings because we couldn't load language files. But I won't try to change all of those in this PR. |
Previously, trying to load any language strings required the theme to be loaded, which in turn required the database to be loaded. Now we simply skip the theme stuff if the database is not available.