SymfonyBundleFrameworkBundleTestWebTestCase class not found










3















I created fresh Symfony 4.1.x project, but when I'm trying to create and execute functional test I am getting error:




PHP Fatal error: Class
'SymfonyBundleFrameworkBundleTestWebTestCase' not found in
/home/tomasz/my_project/tests/ExampleControllerTest.php on line 7




Steps to reproduce:




  1. Create project



    composer create-project symfony/skeleton my_project




  2. Install phpunit, functional tests components and maker for generating skeleton of functional test



    composer req --dev symfony/phpunit-bridge symfony/css-selector symfony/browser-kit symfony/maker-bundle




  3. Create example functional test



    bin/console make:functional-test ExampleControllerTest



Content of created file:



<?php

namespace AppTests;

use SymfonyBundleFrameworkBundleTestWebTestCase;

class ExampleControllerTest extends WebTestCase

public function testSomething()

$client = static::createClient();
$crawler = $client->request('GET', '/');

$this->assertSame(200, $client->getResponse()->getStatusCode());
$this->assertContains('Hello World', $crawler->filter('h1')->text());





  1. Run tests



    bin/phpunit



Output (after installing phpunit dependencies):




PHP Fatal error: Class
'SymfonyBundleFrameworkBundleTestWebTestCase' not found in
/home/tomasz/my_project/tests/ExampleControllerTest.php on line 7




I checked and class SymfonyBundleFrameworkBundleTestWebTestCase does exist in vendor/. Any clues?



phpunit.xml.dist



<?xml version="1.0" encoding="UTF-8"?>

<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
>
<php>
<ini name="error_reporting" value="-1" />
</php>

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

<filter>
<whitelist>
<directory>src</directory>
</whitelist>
</filter>

<listeners>
<listener class="SymfonyBridgePhpUnitSymfonyTestsListener" />
</listeners>
</phpunit>









share|improve this question



















  • 1





    Could you post the contents of your phpunit.xml.dist file?

    – Chris
    Nov 14 '18 at 10:14











  • @Chris question is updated

    – Tomasz
    Nov 14 '18 at 10:16











  • Have a look at the docs, especially the part about the WebTestCase class, symfony.com/doc/current/testing.html#your-first-functional-test. (<env name="KERNEL_CLASS" value="AppKernel" /> in the php block)

    – Chris
    Nov 14 '18 at 10:57











  • @Chris I did that, but it is not solving the issue

    – Tomasz
    Nov 14 '18 at 11:12






  • 3





    @Chris it's confirmed and marked as bug - I made a issue report in symfony/symfony repository @ github.com/symfony/symfony/issues/29215

    – Tomasz
    Nov 14 '18 at 11:21















3















I created fresh Symfony 4.1.x project, but when I'm trying to create and execute functional test I am getting error:




PHP Fatal error: Class
'SymfonyBundleFrameworkBundleTestWebTestCase' not found in
/home/tomasz/my_project/tests/ExampleControllerTest.php on line 7




Steps to reproduce:




  1. Create project



    composer create-project symfony/skeleton my_project




  2. Install phpunit, functional tests components and maker for generating skeleton of functional test



    composer req --dev symfony/phpunit-bridge symfony/css-selector symfony/browser-kit symfony/maker-bundle




  3. Create example functional test



    bin/console make:functional-test ExampleControllerTest



Content of created file:



<?php

namespace AppTests;

use SymfonyBundleFrameworkBundleTestWebTestCase;

class ExampleControllerTest extends WebTestCase

public function testSomething()

$client = static::createClient();
$crawler = $client->request('GET', '/');

$this->assertSame(200, $client->getResponse()->getStatusCode());
$this->assertContains('Hello World', $crawler->filter('h1')->text());





  1. Run tests



    bin/phpunit



Output (after installing phpunit dependencies):




PHP Fatal error: Class
'SymfonyBundleFrameworkBundleTestWebTestCase' not found in
/home/tomasz/my_project/tests/ExampleControllerTest.php on line 7




I checked and class SymfonyBundleFrameworkBundleTestWebTestCase does exist in vendor/. Any clues?



phpunit.xml.dist



<?xml version="1.0" encoding="UTF-8"?>

<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
>
<php>
<ini name="error_reporting" value="-1" />
</php>

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

<filter>
<whitelist>
<directory>src</directory>
</whitelist>
</filter>

<listeners>
<listener class="SymfonyBridgePhpUnitSymfonyTestsListener" />
</listeners>
</phpunit>









share|improve this question



















  • 1





    Could you post the contents of your phpunit.xml.dist file?

    – Chris
    Nov 14 '18 at 10:14











  • @Chris question is updated

    – Tomasz
    Nov 14 '18 at 10:16











  • Have a look at the docs, especially the part about the WebTestCase class, symfony.com/doc/current/testing.html#your-first-functional-test. (<env name="KERNEL_CLASS" value="AppKernel" /> in the php block)

    – Chris
    Nov 14 '18 at 10:57











  • @Chris I did that, but it is not solving the issue

    – Tomasz
    Nov 14 '18 at 11:12






  • 3





    @Chris it's confirmed and marked as bug - I made a issue report in symfony/symfony repository @ github.com/symfony/symfony/issues/29215

    – Tomasz
    Nov 14 '18 at 11:21













3












3








3








I created fresh Symfony 4.1.x project, but when I'm trying to create and execute functional test I am getting error:




PHP Fatal error: Class
'SymfonyBundleFrameworkBundleTestWebTestCase' not found in
/home/tomasz/my_project/tests/ExampleControllerTest.php on line 7




Steps to reproduce:




  1. Create project



    composer create-project symfony/skeleton my_project




  2. Install phpunit, functional tests components and maker for generating skeleton of functional test



    composer req --dev symfony/phpunit-bridge symfony/css-selector symfony/browser-kit symfony/maker-bundle




  3. Create example functional test



    bin/console make:functional-test ExampleControllerTest



Content of created file:



<?php

namespace AppTests;

use SymfonyBundleFrameworkBundleTestWebTestCase;

class ExampleControllerTest extends WebTestCase

public function testSomething()

$client = static::createClient();
$crawler = $client->request('GET', '/');

$this->assertSame(200, $client->getResponse()->getStatusCode());
$this->assertContains('Hello World', $crawler->filter('h1')->text());





  1. Run tests



    bin/phpunit



Output (after installing phpunit dependencies):




PHP Fatal error: Class
'SymfonyBundleFrameworkBundleTestWebTestCase' not found in
/home/tomasz/my_project/tests/ExampleControllerTest.php on line 7




I checked and class SymfonyBundleFrameworkBundleTestWebTestCase does exist in vendor/. Any clues?



phpunit.xml.dist



<?xml version="1.0" encoding="UTF-8"?>

<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
>
<php>
<ini name="error_reporting" value="-1" />
</php>

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

<filter>
<whitelist>
<directory>src</directory>
</whitelist>
</filter>

<listeners>
<listener class="SymfonyBridgePhpUnitSymfonyTestsListener" />
</listeners>
</phpunit>









share|improve this question
















I created fresh Symfony 4.1.x project, but when I'm trying to create and execute functional test I am getting error:




PHP Fatal error: Class
'SymfonyBundleFrameworkBundleTestWebTestCase' not found in
/home/tomasz/my_project/tests/ExampleControllerTest.php on line 7




Steps to reproduce:




  1. Create project



    composer create-project symfony/skeleton my_project




  2. Install phpunit, functional tests components and maker for generating skeleton of functional test



    composer req --dev symfony/phpunit-bridge symfony/css-selector symfony/browser-kit symfony/maker-bundle




  3. Create example functional test



    bin/console make:functional-test ExampleControllerTest



Content of created file:



<?php

namespace AppTests;

use SymfonyBundleFrameworkBundleTestWebTestCase;

class ExampleControllerTest extends WebTestCase

public function testSomething()

$client = static::createClient();
$crawler = $client->request('GET', '/');

$this->assertSame(200, $client->getResponse()->getStatusCode());
$this->assertContains('Hello World', $crawler->filter('h1')->text());





  1. Run tests



    bin/phpunit



Output (after installing phpunit dependencies):




PHP Fatal error: Class
'SymfonyBundleFrameworkBundleTestWebTestCase' not found in
/home/tomasz/my_project/tests/ExampleControllerTest.php on line 7




I checked and class SymfonyBundleFrameworkBundleTestWebTestCase does exist in vendor/. Any clues?



phpunit.xml.dist



<?xml version="1.0" encoding="UTF-8"?>

<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
>
<php>
<ini name="error_reporting" value="-1" />
</php>

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

<filter>
<whitelist>
<directory>src</directory>
</whitelist>
</filter>

<listeners>
<listener class="SymfonyBridgePhpUnitSymfonyTestsListener" />
</listeners>
</phpunit>






php symfony






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 '18 at 10:16







Tomasz

















asked Nov 14 '18 at 9:58









TomaszTomasz

2,02821425




2,02821425







  • 1





    Could you post the contents of your phpunit.xml.dist file?

    – Chris
    Nov 14 '18 at 10:14











  • @Chris question is updated

    – Tomasz
    Nov 14 '18 at 10:16











  • Have a look at the docs, especially the part about the WebTestCase class, symfony.com/doc/current/testing.html#your-first-functional-test. (<env name="KERNEL_CLASS" value="AppKernel" /> in the php block)

    – Chris
    Nov 14 '18 at 10:57











  • @Chris I did that, but it is not solving the issue

    – Tomasz
    Nov 14 '18 at 11:12






  • 3





    @Chris it's confirmed and marked as bug - I made a issue report in symfony/symfony repository @ github.com/symfony/symfony/issues/29215

    – Tomasz
    Nov 14 '18 at 11:21












  • 1





    Could you post the contents of your phpunit.xml.dist file?

    – Chris
    Nov 14 '18 at 10:14











  • @Chris question is updated

    – Tomasz
    Nov 14 '18 at 10:16











  • Have a look at the docs, especially the part about the WebTestCase class, symfony.com/doc/current/testing.html#your-first-functional-test. (<env name="KERNEL_CLASS" value="AppKernel" /> in the php block)

    – Chris
    Nov 14 '18 at 10:57











  • @Chris I did that, but it is not solving the issue

    – Tomasz
    Nov 14 '18 at 11:12






  • 3





    @Chris it's confirmed and marked as bug - I made a issue report in symfony/symfony repository @ github.com/symfony/symfony/issues/29215

    – Tomasz
    Nov 14 '18 at 11:21







1




1





Could you post the contents of your phpunit.xml.dist file?

– Chris
Nov 14 '18 at 10:14





Could you post the contents of your phpunit.xml.dist file?

– Chris
Nov 14 '18 at 10:14













@Chris question is updated

– Tomasz
Nov 14 '18 at 10:16





@Chris question is updated

– Tomasz
Nov 14 '18 at 10:16













Have a look at the docs, especially the part about the WebTestCase class, symfony.com/doc/current/testing.html#your-first-functional-test. (<env name="KERNEL_CLASS" value="AppKernel" /> in the php block)

– Chris
Nov 14 '18 at 10:57





Have a look at the docs, especially the part about the WebTestCase class, symfony.com/doc/current/testing.html#your-first-functional-test. (<env name="KERNEL_CLASS" value="AppKernel" /> in the php block)

– Chris
Nov 14 '18 at 10:57













@Chris I did that, but it is not solving the issue

– Tomasz
Nov 14 '18 at 11:12





@Chris I did that, but it is not solving the issue

– Tomasz
Nov 14 '18 at 11:12




3




3





@Chris it's confirmed and marked as bug - I made a issue report in symfony/symfony repository @ github.com/symfony/symfony/issues/29215

– Tomasz
Nov 14 '18 at 11:21





@Chris it's confirmed and marked as bug - I made a issue report in symfony/symfony repository @ github.com/symfony/symfony/issues/29215

– Tomasz
Nov 14 '18 at 11:21












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53297412%2fsymfony-bundle-frameworkbundle-test-webtestcase-class-not-found%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53297412%2fsymfony-bundle-frameworkbundle-test-webtestcase-class-not-found%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Use pre created SQLite database for Android project in kotlin

Darth Vader #20

Ondo