在Symfony升级之后,composer.json
"symfony/symfony":"2.4.*",
"symfony/symfony":"2.7.*",
我在运行phpunit测试时出错。在env、dev和prod中,一切都很好。
日志输出:
request.CRITICAL: Uncaught PHP Exception Twig_Error_Runtime: "The native_profiler" extension is not enabled in "@WebPro
使用Symfony 2.0,我有一个在本地主机上正常工作的整个系统。
现在我试着把它上传到一个网络主机上。在犯了一些错误之后,我被困在这里:
Fatal error: Class 'PHPUnit_Framework_TestCase' not found in /home/preparatest/www/Symfony/vendor/symfony/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php
(顺便说一句,这个类确实存在于该目录中)。
有人经历过这个吗?
注意:我并不是特别配置PHPUnit。我想它只是包含在
我正在尝试创建一个从symfony的容器访问服务的PHPunit测试。为此,我在setUpBeforeClass中调用self::bootKernel。在第一个测试中,self::$kernel是ok的,但是第二个测试的self::$kernel是空的。 这是一个检查它的简单测试: <?php
namespace App\Tests;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class KernelTest extends WebTestCase
{
public static function setUp
我需要一些支持。:)
我克隆了symfony/symfony,运行了composer update,在尝试运行测试时得到了这个结果:
[emil:~/Development/symfony](2.8) $ php ./phpunit symfony
Warning: require(/Users/emil/Development/symfony/.phpunit/phpunit-4.8/vendor/autoload.php): failed to open stream: No such file or directory in /Users/emil/Development/symfon
我尝试在Symfony中运行一些功能测试,但它们不起作用。运行以整个AppBundle为目标的phpunit将导致"No tests“,而以特定类为目标将导致以下错误:
$ phpunit tests/AppBundle/ApplicationAvailabilityFunctionalTest.php
PHP Fatal error: Uncaught PHPUnit\Runner\Exception: Class 'tests/AppBundle/ApplicationAvailabilityFunctionalTest' could not be found i
在尝试PHPUnit功能测试时,我得到了错误:
1) TreningBundle\Tests\Controller\DefaultControllerTest::testIndex
RuntimeException: Either set KERNEL_DIR in your phpunit.xml according to https://symfony.com/doc/current/book/testing.html#your-first-functional-test or override the WebTestCase::createKernel() method.
说:
如果内
我在PhpStorm中的Symfony项目中运行phpunit遇到了麻烦-- phpunit -c app在OSX终端上运行得很好。
下面是错误:
Unable to attach test reporter to test framework of test framework quit unexpectedly
/Applications/MAMP/bin/php/php5.4.4/bin/php/private/var/folders/4l/hw8g4qlj6nnc37lfkc6hcj7w0000gn/T/ide-phpunit.php --bootstrap
/Users/greg/R
在调试PHPUnit_Framework_TestCase中的测试类( PhpStorm的子类)时,它会停止在该类中设置的断点上,但不会停止在请求指向的控制器(Symfony)中。
//test class - here debugger stops
class FooControllerTest extends \PHPUnit_Framework_TestCase
{
public function testPOST()
{
$response = $this->client->post('/api/foo', [
我有一个基于Symfony 3.x的后端系统,我在PHPStorm 2017.x上工作。MySQL是一个只有Apache和MySQL的常规XAMPP5.6.8堆栈,我将最新兼容的phpunit.phar (5.7.20)应用于XAMPP -目录中的"php"-folder。我应该使用运行PHPUnit测试,但是内部PHPStorm终端显示一个错误:
Fatal error: Class 'PHPUnit\Framework\TestCase' not found in O:\%PROJECT_DIR%\vendor\symfony\symfony\src\Sym
在一个非常简单的标准测试中调用phpunit时,它会产生以下输出和错误:
命令(在symfony2根中):
phpunit -c build/ src
输出:
PHPUnit 4.1.6-6-g43914fa by Sebastian Bergmann.
Configuration read from /srv/xxxxxxxxx/build/phpunit.xml
PHP Fatal error: Declaration of Symfony\Bridge\Doctrine\ContainerAwareEventManager::removeEventListener() must b
自从升级到Symfony 2.8后,当我在Symfony根目录下运行phpunit时,我得到了以下错误:
PHP Fatal error: Class 'PHPUnit_Util_ErrorHandler' not found in /var/www/foo/symfony/vendor/symfony/phpunit-bridge/DeprecationErrorHandler.php on line 40
PHP Stack trace:
PHP 1. {main}() /usr/bin/phpunit:0
PHP 2. PHPUnit_TextUI_Comman
在对WebTestCase类进行功能测试时,它认为@Route注释不起作用。
我的控制器看起来像这样:
<?php
namespace Foo\ShopBundle\Controller;
use Foo\ShopBundle\Entity\Cart;
use Foo\ShopBundle\Entity\ProductInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
我不完全确定是什么导致了这个问题,特别是因为我已经遵循了官方文档。我也在这里读过无数的Google Group讨论和问题,但都无济于事。
因此,我一直在Fabien Potencier的上构建我的应用程序,但我的单元测试在一个页面上使用FormServiceProvider的表单上失败了。
PHPUnit 3.6.12 by Sebastian Bergmann.
Configuration read from /Users/Adam/Sites/AppEngine/phpunit.xml
..E
Time: 0 seconds, Memory: 10.00Mb
There was 1
大家好,我正在尝试在laravel 7.4中安装媒体库,但出现了以下错误:
Problem 1
- Installation request for symfony/console 5.0.1 -> satisfiable by symfony/console[v5.0.1].
- Installation request for spatie/laravel-medialibrary ^8.1 -> satisfiable by spatie/laravel-medialibrary[8.1.0].
- Can only install one of: symfony/proce
我安装了一个新版本的Symfony的3.2.5_demo,没有在上面做任何更改。
当我运行phpunit时,我得到了以下内容:
类"\DAMA\DoctrineTestBundle\PHPUnit\PHPUnitStaticDbConnectionListener“不实现PHPUnit\Framework\TestListener接口
这是"PHPUnitStaticDbConnectionListener.php“中的两行:
use DAMA\DoctrineTestBundle\Doctrine\DBAL\StaticDriver;
class PHPUnitSta
我试着用PHPUnit v8。然而,我并没有成功地使用PhpStorm。当我在PhpStorm中运行简单的测试(类方法)时,我得到以下消息: PHP Fatal error: Uncaught PHPUnit\Runner\Exception: Class 'Mrself\\TreeType\\Tests\\Functional\\BuildingTest' could not be found in '/vagrant/symfony-tree-type/tests/Functional/BuildingTest.php'. in /vagrant/sym