I ran into similar problems with PHPUnit on my Mac running Zend Server CE.
My problem was that PHPUnit was using the wrong PHP bin. I edited the file
/usr/local/bin/phpunit and changed the path to the php bin at the top to
read:

#!/usr/local/zend/bin/php


I hope this helps.

--
Hector


On Thu, Feb 11, 2010 at 11:33 AM, Ron Dyck <pulpfr...@gmail.com> wrote:

> After reading various articles on TDD and Zend_Test I've decided to
> integrate them in my development cycle.. Things were quite successful until
> I required the db adapter.
> I'm able to access all my resources successfully but appears as though I
> cannot connect to the db.
>
> I created a zend test that requires a simple login. The test requires a
> call to my db resource to validate the username and password. From what I
> can see in my logs the Db Adapter does not connect.
>
> 2010-02-11T12:55:08-05:00 CRIT (2): exception
> 'Zend_Db_Adapter_Mysqli_Exception' with message 'No such file or directory'
> in /private/var/www/shared/ZF-1.10.1/Zend/Db/Adapter/Mysqli.php:333
> Stack trace:
> #0 /private/var/www/shared/ZF-1.10.1/Zend/Db/Adapter/Abstract.php(832):
> Zend_Db_Adapter_Mysqli->_connect()
> #1
> /private/var/www/webbtech/webbtech_admin/library/App/User/AuthAdapter.php(306):
> Zend_Db_Adapter_Abstract->quote('1c257c525e1339e...')
> ...
>
> My test looks like this:
>
>     public function testLoginAction()
>     {
>         $this->dispatch('/login');
>
>         $data = array(
>            'username' => 'USERNAME',
>            'password'  => 'PASSWORD',
>         );
>         $request = $this->getRequest();
>         $request->setMethod('POST')
>                 ->setPost($data);
>         $this->dispatch('/login/process-login');
>         $this->assertController('index');
>     }
>
> The last assertion fails:
> Failed asserting last controller used <"error"> was "index"
>
> I'm using ZF 1.10.1 with ZendServer CE 4.0.6 on Snow Leopard.
> BTW, I got this same error when attempting to execute a CLI php file using
> php as opposed to php-cli. This leads me to believe it's a file permission
> in my environment.
>
>
> Any help is appreciated. Frustrated that this is stalling my new TDD
> process.
>
> --
> =================
> Ron Dyck
> pulpfr...@gmail.com
> www.webbtech.net
> =================
>

Reply via email to