symfony 2.1:phpunit -c app试图运行symfony核心测试

时间:2012-09-23 23:51:51

标签: symfony phpunit

在我的Symfony 2.1应用中,我无法运行recommended phpunit -c app/。我收到以下错误消息(我添加了换行符):

PHPUnit 3.6.10 by Sebastian Bergmann.

Configuration read from /symfony2-dual-auth/app/phpunit.xml.dist

F

PHP Fatal error:  main(): Failed opening required
'/symfony2-dual-auth/vendor/symfony/symfony/vendor/autoload.php'  
(include_path='.:/usr/share/php:/usr/share/pear')
in /symfony2-dual-auth/vendor/symfony/symfony/autoload.php.dist on line 3

此处填写完整的源代码:https://github.com/meonkeys/symfony2-dual-auth。除了测试,因为它没有通过。这是src/Oh/FOSFacebookUserBundle/Tests/SimpleFunctionalTest.php ...

<?php

namespace Oh\FOSFacebookUserBundle\Tests;

use Symfony\Bundle\FrameworkBundle\Tests\Functional\WebTestCase;

class SimpleFunctionTest extends WebTestCase {

  public function testIndex() {
    $client = static::createClient();

    $crawler = $client->request('GET', '/login');

    $this->assertEquals(1, $crawler->filter('html:contains("Remember me")')->count());
  }

}

1 个答案:

答案 0 :(得分:6)

我正在扩展wong课程。 Here's the fix

-use Symfony\Bundle\FrameworkBundle\Tests\Functional\WebTestCase;
+use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;