I'm using Magento\Catalog\Model\CategoryFactory
in my module and in unit tests.
Unit tests doesn't pass because CategoryFactory
doesn't exists.
Class CategoryFactory
exists in generated
directory and doesn't exists in vendor
. Magento 2 in first order check generated
directory and if there is no searched class, then search inside vendor
directory.
Directory generated
was deleted many times and now have rights 777. I clean it many times and nothings help. During compile (setup:di:compile
), Magento 2 creates needed files but some files doesn't use.
Earlier this code works and nothings change inside code, only programming environment. I'm using vagrant and CentOs on VirtualBox.
The same problem is with other *Factory classes.
Do You have any idea, what is the problem?
bin/magento setup:di:compile
which will generate all necessary classessetup:di:compile