Skip to content

Conversation

@yceruto
Copy link
Member

@yceruto yceruto commented Aug 30, 2017

By convention, the tests/AppBundle directory should replicate the directory of your bundle for unit tests. So, if you're testing a class in the src/AppBundle/Util/ directory, put the test in the tests/AppBundle/Util/ directory. (http://symfony.com/doc/current/testing.html)

The future version of it for 3.4/4.0 would be:

By convention, the tests/ directory should replicate your src directory for unit tests. So, if you're testing a class in the src/Util/ directory, put the test in the tests/Util/ directory.

Nothing to update in composer.json as PSR-4 autoload-dev section already known about this.

    "autoload-dev": {
        "psr-4": {
            "App\\Tests\\": "tests/"
        }
    },

@javiereguiluz
Copy link
Member

I totally missed this! Thanks for fixing it.

@javiereguiluz javiereguiluz merged commit ebfe702 into symfony:master Aug 31, 2017
javiereguiluz added a commit that referenced this pull request Aug 31, 2017
…cture (yceruto)

This PR was merged into the master branch.

Discussion
----------

Setting tests directory consistent with src directory structure

> By convention, the `tests/AppBundle` directory should replicate the directory of your bundle for unit tests. So, if you're testing a class in the `src/AppBundle/Util/` directory, put the test in the `tests/AppBundle/Util/` directory. (http://symfony.com/doc/current/testing.html)

The future version of it for 3.4/4.0 would be:
> By convention, the `tests/` directory should replicate your `src` directory for unit tests. So, if you're testing a class in the `src/Util/` directory, put the test in the `tests/Util/` directory.

Nothing to update in `composer.json` as PSR-4 autoload-dev section already known about this.
```json
    "autoload-dev": {
        "psr-4": {
            "App\\Tests\\": "tests/"
        }
    },
```

Commits
-------

ebfe702 Being consistent with src structure
@yceruto yceruto deleted the tests_structure branch August 31, 2017 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants