(jak ktoś chce 15 punktów, czy ile tam się dostaje to proszę na stackoverflow)
test funkcjonalny PHPUnit(5.3.4) w Symfony(2.8) wywala:
Cytat
1) TreningBundle\Tests\Controller\DefaultControllerTest::testIndex
RuntimeException: Either set KERNEL_DIR in your phpunit.xml according to https://symfony.com/doc/current/book/testin...functional-test or override the WebTestCase::createKernel() method.
RuntimeException: Either set KERNEL_DIR in your phpunit.xml according to https://symfony.com/doc/current/book/testin...functional-test or override the WebTestCase::createKernel() method.
mimo że pracuję na świeżym Symfony, którego dopiero co zainstalowałem do treningu PHPUnit. Bo dokumentacja SYmfony mówi:
Cytat
if your kernel is in a non-standard directory, you'll need to modify your phpunit.xml.dist
phpunit.xml.dist i AppKErnel.php mam w domyślnym miejscu Symfony (2.8) , w app\. Tak czy sik dodałem do pliku app/phpunit.xml.dist:
Cytat
<php>
<server name="KERNEL_DIR" value="./" /> //lub "app/"
</php>
<server name="KERNEL_DIR" value="./" /> //lub "app/"
</php>
co niczego nie poprawiło. Dalej error.
Zainstalowane paczki
Cytat
phpunit/php-code-coverage 3.3.2
phpunit/php-file-iterator 1.4.1
phpunit/php-text-template 1.2.1
phpunit/php-timer 1.0.8
phpunit/php-token-stream 1.4.8
phpunit/phpunit 5.3.4
phpunit/phpunit-mock-objects 3.1.3
phpunit/phpunit-skeleton-generator 2.0.1
sebastian/code-unit-reverse-lookup 1.0.0
sebastian/comparator 1.2.0
sebastian/diff 1.4.1
sebastian/environment 1.3.7
sebastian/exporter 1.2.1
sebastian/global-state 1.1.1
sebastian/object-enumerator 1.0.0
sebastian/recursion-context 1.0.2
sebastian/resource-operations 1.0.0
sebastian/version 1.0.6
symfony/phpunit-bridge v2.8.6
symfony/symfony v2.8.6
phpunit/php-file-iterator 1.4.1
phpunit/php-text-template 1.2.1
phpunit/php-timer 1.0.8
phpunit/php-token-stream 1.4.8
phpunit/phpunit 5.3.4
phpunit/phpunit-mock-objects 3.1.3
phpunit/phpunit-skeleton-generator 2.0.1
sebastian/code-unit-reverse-lookup 1.0.0
sebastian/comparator 1.2.0
sebastian/diff 1.4.1
sebastian/environment 1.3.7
sebastian/exporter 1.2.1
sebastian/global-state 1.1.1
sebastian/object-enumerator 1.0.0
sebastian/recursion-context 1.0.2
sebastian/resource-operations 1.0.0
sebastian/version 1.0.6
symfony/phpunit-bridge v2.8.6
symfony/symfony v2.8.6
ze ścieżka absolutną to samo:
Cytat
<server name="KERNEL_DIR" value="C:\wamp\www\treningPHPUnitSymfony2.8\app" />
edit:
Nawet z ze świeżym SYmfony3.0 i świeżym PHPUnit5.3.4 to samo
There was 1 error:
Cytat
1) Tests\AppBundle\Controller\DefaultControllerTest::testIndex
RuntimeException: Unable to guess the Kernel directory.
RuntimeException: Unable to guess the Kernel directory.
rozwiązanie: konfigurując Test w phpstorm trzeba podać ścieżkę do phpunit.xml.dist.