@@ -62,7 +62,7 @@ called ``Calculator`` in the ``Util/`` directory of the app bundle::
62
62
}
63
63
}
64
64
65
- To test this, create a ``CalculatorTest `` file in the ``tests/AppBundle/ Util `` directory
65
+ To test this, create a ``CalculatorTest `` file in the ``tests/Util `` directory
66
66
of your application::
67
67
68
68
// tests/Util/CalculatorTest.php
@@ -85,9 +85,9 @@ of your application::
85
85
86
86
.. note ::
87
87
88
- By convention, the ``tests/AppBundle `` directory should replicate the directory
88
+ By convention, the ``tests/ `` directory should replicate the directory
89
89
of your bundle for unit tests. So, if you're testing a class in the
90
- ``src/Util/ `` directory, put the test in the ``tests/AppBundle/ Util/ ``
90
+ ``src/Util/ `` directory, put the test in the ``tests/Util/ ``
91
91
directory.
92
92
93
93
Just like in your real application - autoloading is automatically enabled
@@ -102,13 +102,13 @@ Running tests for a given file or directory is also very easy:
102
102
$ phpunit
103
103
104
104
# run all tests in the Util directory
105
- $ phpunit tests/AppBundle/ Util
105
+ $ phpunit tests/Util
106
106
107
107
# run tests for the Calculator class
108
- $ phpunit tests/AppBundle/ Util/CalculatorTest.php
108
+ $ phpunit tests/Util/CalculatorTest.php
109
109
110
110
# run all tests for the entire Bundle
111
- $ phpunit tests/AppBundle/
111
+ $ phpunit tests/
112
112
113
113
.. index ::
114
114
single: Tests; Functional tests
@@ -129,7 +129,7 @@ tests as far as PHPUnit is concerned, but they have a very specific workflow:
129
129
Your First Functional Test
130
130
~~~~~~~~~~~~~~~~~~~~~~~~~~
131
131
132
- Functional tests are simple PHP files that typically live in the ``tests/AppBundle/ Controller ``
132
+ Functional tests are simple PHP files that typically live in the ``tests/Controller ``
133
133
directory for your bundle. If you want to test the pages handled by your
134
134
``PostController `` class, start by creating a new ``PostControllerTest.php ``
135
135
file that extends a special ``WebTestCase `` class.
@@ -757,7 +757,7 @@ Testing Configuration
757
757
---------------------
758
758
759
759
The Client used by functional tests creates a Kernel that runs in a special
760
- ``test `` environment. Since Symfony loads the ``app/ config/config_test.yml ``
760
+ ``test `` environment. Since Symfony loads the ``config/packages/test/*.yaml ``
761
761
in the ``test `` environment, you can tweak any of your application's settings
762
762
specifically for testing.
763
763
@@ -769,15 +769,15 @@ configuration option:
769
769
770
770
.. code-block :: yaml
771
771
772
- # app/ config/config_test.yml
772
+ # config/packages/test/swiftmailer.yaml
773
773
774
774
# ...
775
775
swiftmailer :
776
776
disable_delivery : true
777
777
778
778
.. code-block :: xml
779
779
780
- <!-- app/ config/config_test .xml -->
780
+ <!-- config/packages/test/swiftmailer .xml -->
781
781
<?xml version =" 1.0" encoding =" UTF-8" ?>
782
782
<container xmlns =" http://symfony.com/schema/dic/services"
783
783
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
@@ -793,7 +793,7 @@ configuration option:
793
793
794
794
.. code-block :: php
795
795
796
- // app/ config/config_test .php
796
+ // config/packages/test/swiftmailer .php
797
797
798
798
// ...
799
799
$container->loadFromExtension('swiftmailer', array(
@@ -847,7 +847,7 @@ only.
847
847
Store the ``phpunit.xml.dist `` file in your code repository and ignore
848
848
the ``phpunit.xml `` file.
849
849
850
- By default, only the tests stored in ``/ tests `` are run via the ``phpunit `` command,
850
+ By default, only the tests stored in ``tests/ `` are run via the ``phpunit `` command,
851
851
as configured in the ``phpunit.xml.dist `` file:
852
852
853
853
.. code-block :: xml
0 commit comments