2016-04-04 126 views
1

我想在Symfony 3框架中进行单元测试。这是我的配置; Run/Debug ConfigirationsPHPStorm - 进程完成退出代码255

PHPUnit Preferences

这里是我面对错误。

/Applications/MAMP/bin/php/php7.0.0/bin/php /private/var/folders/w9/cmwlplqx53x3slxkm4c1chx00000gn/T/ide-phpunit.php --bootstrap /Users/muhammetergenc/code/kampweb/phpunit.xml.dist --configuration /Users/muhammetergenc/code/kampweb/phpunit.xml.dist Tests\AppBundle\Controller\PersonTest /Users/muhammetergenc/code/kampweb/tests/AppBundle/Controller/PersonTest.php 
Testing started at 3:04 PM ... 
<?xml version="1.0" encoding="UTF-8"?> 

<!-- http://phpunit.de/manual/4.1/en/appendixes.configuration.html --> 
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd" 
     backupGlobals="false" 
     colors="true" 
     bootstrap="app/autoload.php"> 

    <!-- <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd" 
      backupGlobals="false" 
      colors="true" 
      bootstrap="web/app_test.php">--> 
    <php> 
     <ini name="error_reporting" value="-1" /> 
     <server name="KERNEL_DIR" value="app/" /> 
    </php> 

    <testsuites> 
     <testsuite name="Project Test Suite"> 
      <directory>tests</directory> 
     </testsuite> 
    </testsuites> 

    <filter> 
     <whitelist> 
      <directory>src</directory> 
      <exclude> 
       <directory>src/*Bundle/Resources</directory> 
       <directory>src/*/*Bundle/Resources</directory> 
       <directory>src/*/Bundle/*Bundle/Resources</directory> 
      </exclude> 
     </whitelist> 
    </filter> 
</phpunit> 

Process finished with exit code 255 

我在我的其他桌面上有相同的配置,它工作得很好。

+1

您已将其设置为使用XML文件作为引导文件,然后尝试将XML作为PHP运行并失败。 – JimL

+0

@JimL不会被忽略吗如果不是PHP类扩展PHPUnit框架呢? –

+0

我取消选中了默认引导文件选项,但仍然收到相同的错误。 @JimL – mburakergenc

回答

0

今天我有同样的错误 - 255. 在我的情况下,我没有在setUp方法中声明CONSTANS。

我认为你有类似的东西。 尝试通过使用xdebug找到它 - 它帮助我。