Conan

Last time I tried SS 4 with PHP 7.4 I did get a lot of "deprecated ..." warnings but no exceptions I think.

Conan

Okay, well in that case I think I will just check if an array has been set and if not use default, instead of forcing users to set it to null first (as users will most likely want to change this config value, data object group permissions) 🙂 > There was a proposal a while back to flag arrays as “override” and not “merge”, but nothing has come of it yet Would be nice to have!

And also @kinglozzer thanks for the info! 👏

Conan

> The exception is arrays which get merged instead of overwritten ^that I'm taking an array as a config value, so arrays are not possible to override from yml files?

Conan

https://docs.silverstripe.org/en/4/developer_guides/configuration/configuration/

  1. Configuration Values
  2. ... These sources do not override each other - instead the values from each source are merged together to give the final configuration value ...

I thought it was okay to add a default config.yml file in a module and that it was possible to override those values from another config file, but that is not the case? How should one handle default config values for a module, should you have code like if (!$config_value) {...set default values...}?

Conan

True, I didn't notice there was key value pairs in the example 🙂

Conan

Is the Court field defined as an Enum? If so you can get the enum values like e.g. $dataObject->dbObject('Court')->enumValues(); where needed.

Conan

We're 1899 people in this channel, but the SilverStripe framework has just 664 stars on github. 🤯 If you feel guilty, no worries it's never too late! https://github.com/silverstripe/silverstripe-framework go and hit that !

Conan

667 stars now 🌠! how far can we go? (;

Conan
Conan in #testing 2019-11-27 20:24:04 (edited) (deleted)

Howdy 👋 I just got into SilverStripe testing (after finally getting PHPUnit to run my tests) and I wonder if anyone of you know where to find good examples of different kind of tests? I looked in some popular modules like fluent, framework and elemental but I didn't find any test file where they tested e.g. model validation. I did not spend much time googling around as I just wanted to get started, so I guess I will find what I'm looking for at some point :--)

So I just created my own model validation test and I thought I'd share it here and ask politely 👼 if you have some good advice on how to write this kind of test? (There are no stupid questions, just stupid people )

Conan
Conan in #testing 2019-11-27 18:56:08 (edited) (deleted)

This is the default phpcs.xml file created by the silverstripe installer. How do I configure the file so I only need to run vendor\bin\phpunit.bat and it would run all *Test.php files it can find? Except for test files inside the vendor folder ofc, but it seems to be excluded by default. Currenly I need to run vendor\bin\phpunit.bat <module-folder> in order for it to run tests in a module.

Conan

Alright, the stable version of 7.4 should be released tomorrow 🙂 according to Google.