I am new to Unit testing and trying to use Phactory with Mongo, but when I run the test I keep getting the following error.
PHP Fatal error: Class 'Mongo' not found in /vagrant/Test/user/LoginTest.php on line 19
I know Mongo is installed because when I pull up the site it works, but for some reason PHPUnit isn't recognizing it.
I feel I am missing a step. Do I need to install the Mongo extension locally, or do I need to include the location in a config file somewhere?
Are you sure Mongo is installed as a module in the command line version of PHP?
Do a quick run of
php -iand have a look at the output (which isphpinfo()without fancy formatting) orphp -mfor a list of modules. If the Mongo extension does not show up, you have to install it.Also note that the
Mongoclass has been deprecated. You'd probably update to usingMongoClient.