dounei5721 2010-08-28 14:42
浏览 42
已采纳

PHPUnit:使用<“error”>断言最后一个控制器失败

I am working on a ZF project wich use a postgre database, on my local server (ubuntu 10.04 LTS Lucid Lynx).
I'm trying to run a very simple test with phpunit:

    public function testIndexAction() {
        $this->dispatch('/');  
        $this->assertController('index');  
        $this->assertAction('index');  
        $this->assertModule('default');  
        $this->assertXpathContentContains('/html/body/div[1]/div[@id=\'content\']/p', 'Los puntos de mis amigos son mis amigos..');  
    }

but it fails on the first assertion with this message:

Failed asserting last controller used <"error"> was "index"
I found this question where the author had the same problem: he solved it by adding to his 2nd php.ini the php_pdo_pgsql.dll library. But he's on windows and using xampp.
Anyway I checked it: the /etc/php5/apache2/php.ini has those 3 lines:
extension=msql.so
extension=pgsql.so
extension=pdo_pgsql.so
and I added them in the other php.ini file I found: /etc/php5/cli/php.ini and now when I run the test it says:
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/msql.so' - /usr/lib/php5/20090626+lfs/msql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/pdo_pgsql.so' - /usr/lib/php5/20090626+lfs/pdo_pgsql.so: undefined symbol: php_pdo_register_driver in Unknown on line 0
PHP Warning:  Module 'pgsql' already loaded in Unknown on line 0
and now I''m really out of ideas...
Can anyone point me in the right direction?
thanx
  • 写回答

1条回答 默认 最新

  • dshu1235 2011-09-20 14:36
    关注

    It turned out that there was one column missing in one table of my test db. I added it and now it's fine. As I had spent the last few hours trying to get phpunit working I was still thinking about general configuration, not about my code.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 potsgresql15备份问题
  • ¥15 Mac系统vs code使用phpstudy如何配置debug来调试php
  • ¥15 目前主流的音乐软件,像网易云音乐,QQ音乐他们的前端和后台部分是用的什么技术实现的?求解!
  • ¥60 pb数据库修改与连接
  • ¥15 spss统计中二分类变量和有序变量的相关性分析可以用kendall相关分析吗?
  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上