I have started writing unit tests for my pimcore bundles with the codeception Tutorial.
However I don’t understand one thing: Why can I not use the already defined classes in
var/classes when testing? I use the TestHelper to create and bootstrap a new database for testing, because that makes sense. But why doesn’t the created database include the classes in my project already?
I know I can create the classes by providing a JSON file to their exports, but… Wouldn’t it make much more sense that the tests use the same data classes as the final code? When I change something in a class, I now need to export that classes json, so the tests can use the updated version as well.
I assume I am missing something obivous, because that system doesn’t make a whole lot of sense to me. It produced redundant information about the class definitions: One for production code, one for testing…?