i am using redbeanPHP since two years. On my new project i wan´t to implement unit-tests from the beginning.
I installed phpUnit and without the database connection all works fine. I now wan´t to test my classes with database intigration. I know this is not a unit-test anymore. But i thing it will help me a lot to auto test the functionality from the implementation.
I call R::setup("mysql:host=localhost;dbname=ufm","root","root");
in my setup file which i declared as bootstrap file for phpUnit.
If i now run my tests i get:
PDOException: Could not connect to database (ufm).
phar:///Applications/MAMP/htdocs/ufm/core/plugins/rb.phar/RedBeanPHP/Driver/RPDO.php:280
phar:///Applications/MAMP/htdocs/ufm/core/plugins/rb.phar/RedBeanPHP/Driver/RPDO.php:126
phar:///Applications/MAMP/htdocs/ufm/core/plugins/rb.phar/RedBeanPHP/Driver/RPDO.php:289
phar:///Applications/MAMP/htdocs/ufm/core/plugins/rb.phar/RedBeanPHP/Adapter/DBAdapter.php:79
phar:///Applications/MAMP/htdocs/ufm/core/plugins/rb.phar/RedBeanPHP/QueryWriter/AQueryWriter.php:576
phar:///Applications/MAMP/htdocs/ufm/core/plugins/rb.phar/RedBeanPHP/OODB.php:893
phar:///Applications/MAMP/htdocs/ufm/core/plugins/rb.phar/RedBeanPHP/Facade.php:463
/Applications/MAMP/htdocs/ufm/tests/TurnierTest.php:14
The strange thing is that i am using the same setup file in my normal application. There all works fine.
Has phpUnit or redbeanPHP any limitations for database connection in the bootstrap file? I searched for two days now but i can´t find any documentation about this. I only found a blogpost on google groups where some guy successfully makes the exact same thing.
Thanks for your help. Best regards,schw4ndi