Skip to content

Tests to Test renamed #71

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions guides/bundles/best_practices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The basic directory structure of a ``HelloBundle`` bundle must read as follows::
translations/
views/
public/
Tests/
Test/

The ``XXX`` directory(ies) reflects the namespace structure of the bundle.

Expand Down Expand Up @@ -93,7 +93,7 @@ Type Directory
Controllers ``Controller/``
Translation files ``Resources/translations/``
Templates ``Resources/views/``
Unit and Functional Tests ``Tests/``
Unit and Functional Tests ``Test/``
Web Resources ``Resources/public/``
Configuration ``Resources/config/``
Commands ``Command/``
Expand Down Expand Up @@ -131,7 +131,7 @@ Tests
-----

A bundle should come with a test suite written with PHPUnit and stored under
the ``Tests/`` directory. Tests should follow the following principles:
the ``Test/`` directory. Tests should follow the following principles:

* The test suite must be executable with a simple ``phpunit`` command run from
a sample application;
Expand Down
7 changes: 2 additions & 5 deletions guides/testing/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ bundles:
<!-- hello/phpunit.xml.dist -->
<testsuites>
<testsuite name="Project Test Suite">
<directory>../src/Application/*/Tests</directory>
<directory>../src/Bundle/*/Tests</directory>
<directory>../src/Application/*/Test</directory>
</testsuite>
</testsuites>

Expand All @@ -45,9 +44,7 @@ section:
<directory>../src/Bundle</directory>
<exclude>
<directory>../src/Application/*/Resources</directory>
<directory>../src/Application/*/Tests</directory>
<directory>../src/Bundle/*/Resources</directory>
<directory>../src/Bundle/*/Tests</directory>
<directory>../src/Application/*/Test</directory>
</exclude>
</whitelist>
</filter>
Expand Down
16 changes: 8 additions & 8 deletions guides/testing/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ it yet, you can read its excellent `documentation`_.

Symfony2 works with PHPUnit 3.5 or later.

The default PHPUnit configuration looks for tests under ``Tests/``
The default PHPUnit configuration looks for tests under ``Test/``
sub-directory of your bundles:

.. code-block:: xml
Expand All @@ -29,7 +29,7 @@ sub-directory of your bundles:
<phpunit ... bootstrap="../src/autoload.php">
<testsuites>
<testsuite name="Project Test Suite">
<directory>../src/Application/*/Tests</directory>
<directory>../src/Application/*/Test</directory>
</testsuite>
</testsuites>

Expand Down Expand Up @@ -59,9 +59,9 @@ Unit Tests

Writing Symfony2 unit tests is no different than writing standard PHPUnit unit
tests. By convention, it's recommended to replicate the bundle directory
structure under its ``Tests/`` sub-directory. So, write tests for the
structure under its ``Test/`` sub-directory. So, write tests for the
``Application\HelloBundle\Model\Article`` class in the
``Application/HelloBundle/Tests/Model/ArticleTest.php`` file.
``Application/HelloBundle/Test/Model/ArticleTest.php`` file.

In a unit test, autoloading is automatically enabled via the
``src/autoload.php`` file (as configured by default in the ``phpunit.xml.dist``
Expand All @@ -72,10 +72,10 @@ Running tests for a given file or directory is also very easy:
.. code-block:: bash

# run all tests for the Model
$ phpunit -c app Application/HelloBundle/Tests/Model/
$ phpunit -c app Application/HelloBundle/Test/Model/

# run tests for the Article class
$ phpunit -c app Application/HelloBundle/Tests/Model/ArticleTest.php
$ phpunit -c app Application/HelloBundle/Test/Model/ArticleTest.php

.. index::
single: Tests; Functional Tests
Expand All @@ -98,8 +98,8 @@ to the application. To access such a client, your tests need to extend the
Symfony2 ``WebTestCase`` class. The sandbox provides a simple functional test
for ``HelloController`` that reads as follows::

// src/Application/HelloBundle/Tests/Controller/HelloControllerTest.php
namespace Application\HelloBundle\Tests\Controller;
// src/Application/HelloBundle/Test/Controller/HelloControllerTest.php
namespace Application\HelloBundle\Test\Controller;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

Expand Down