What is the "test" folder in Kirbies core?


Why is that folder there?

What is it doing?

I checked the files inside… and they do contain (test) content (duh…) but why is it there?

And do one need it, while using Kirby for it’s own site?

…just wondering (during the update from 2.1.1 to 2.1.2).

They’re unit tests for the Kirby core. Each unit test checks that a certain feature of the Kirby core returns expected results on different environments. They’re run by Travis CI each time there’s a new commit in the Kirby core repo.

They’re for the development of Kirby and not the development with Kirby.

Correct me if I’m wrong!


Paul’s summary says it all. With the complexity of a system like Kirby you can never know that you didn’t break stuff with a change or addition to the code base. That’s why we try to cover as many cases as possible with such tests. If some old features break while we make changes we get instantly notified by Travis CI and have a chance to react on it before shipping. The test folder has to be part of the core so that Travis CI can pick it up on commits to the repository and execute the tests for us.

You will never need any code inside the test folder for your own projects though.

Wow, cool explanation!

I already thought it had something to do with testing / debugging / controlling - but didn’t know what exactly.

Initially I thought it was something about a (MD5) checksum to check the integrity of the downloaded assets (so you know exactly that the source-code wasn’t altered during the download process (man in the middle).

Thanks again - I will let the /test folder where it is and give it water every day.