chriskite / phactory

A Database Factory for PHP Unit Tests
http://phactory.org
MIT License
140 stars 39 forks source link

Cant find Phactory error when attempting to use with composer. #41

Open eko3alpha opened 9 years ago

eko3alpha commented 9 years ago

You cant use this "as is" with composer. This was something I could not find in the documentation. You must have the following "use" keyword

use Phactory\Sql\Phactory;

at the beginning of your file if you want to use it as it is currently documented. You will get the following error otherwise:

Fatal error: Class 'Phactory' not found in ...

I was really excited to use this library in my unit tests... until none of it really worked. The documentation is horribly outdated. I appreciate the attempt made to make this a composer package, however it does not work at all, and I constantly keep getting errors as I "fix" one item after another.

yang-wei commented 9 years ago

@eko3alpha If you autoload it via composer then just have to.

use \Phactory\Sql\Phactory;

If you are not sure whether it had been autoloaded, check your vendor/composer/autoload_namespaces.php.

Mine looks:

...
'Phactory' => array($vendorDir . '/chriskite/phactory/lib'),
...