Unit Testing in neos

Hi Team ,

I’am new to Neos and been going through the tutorial and had some basic questions about writing test cases . I come from a java background and big fan of being able to have unit test cases for everything . One area that I’am not sure about is how can we write unit test cases for all the different areas such as components , fusion code etc . Also is there any IDE plugins that can do auto complete for fusion and yaml configuration since we don’t have the concept of type safe in php and configuration files.

Thanks in advance

Hi Emily,

welcome to the Neos world! :slight_smile:

There is a very good plugin for PHPStorm that can do auto completion and some other things: https://plugins.jetbrains.com/plugin/9362-neos-support
I think there was also one for the Atom editor.

By now you can define quite a lot of types in PHP and this also works really well with PHPStorm as it shows you incompatibilities.

For the configuration files exist some structure definitions for the core packages. Most plugins don’t provide that, but you can write them for your own configurations.
You can validate the configurations with ./flow configuration:validate.

You can find functional test examples for Fusion in the Neos.Fusion package. This should help you write your own.

The Atom plugin can be found here: https://atom.io/packages/language-typoscript2
There is also a plugin for e.g. Visual Studio Code that supports Fusion: https://marketplace.visualstudio.com/items?itemName=networkteam.neos-fusion=networkteam.neos-fusion
For Yaml you may need to install a separate plugin if your editor doesn’t support it yet.

Concerning the tests, I recommend you also to check out the Neos packages and have a look at the tests there.