Skip to content

PHP Component TestCase

I've finished writing unit tests for this component a few minutes ago so as the a beloved meme would say "things are getting pretty serious" ;-). It is possible i will tag the version "1.0.0" very soon.

What is this component for and where do i get it?
This component is considered as a starting point for creating question and answer test cases. Each test case has one question and one answer type. The current available types of answers are "single answer", "multiple answer" and "free text answer". All three types are using the same interface, so you can use them everywhere. You have to enter an answer to an answer (quite surprising right? ;-)) and the answer has the ability to tell you if your answer was the right one or how correct your current answer is.
The ideal wish is, that a lot of people are writing test cases for different subjects and you just simple use this component and the subjects to create your application or environment to use this test cases to, well, test people or yourself.
You can get the TestCase on or via packagist.

A suite is also there to arrange multiple test cases under one subject. Since this component is using the Configuration Converter, everything can be written down as "YAML", "JSON" or "PHPArray". To illustrate this, you can write a "Suite.yaml" that points to a "TestCase.php" that is using a "Question.php" and a "Answer.yaml". The available factories can handle that if you want to.

The component itself is currently really basic so do not expect that finished "save the world" thing. But the test case stuff is started and truly open source.