Skip to content

Commit 8e49102

Browse files
committed
updated
1 parent a1673b4 commit 8e49102

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

for/symfony.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ sidebar: |
99
* Access Symfony services through the dependecy injection container: `$I->grabService(...)`
1010
* Use Doctrine to test against the database: `$I->seeInRepository(...)`
1111
* Assert that emails would have been sent: `$I->seeEmailIsSent()`
12-
* Different setups for each bundle.
1312
* Tests are wrapped into Doctrine transaction to speed them up.
1413
* Symfony Router can be cached between requests to speed up testing.
1514
@@ -32,7 +31,7 @@ composer require codeception/codeception --dev
3231
## Setup
3332

3433
From Symfony 4 onwards there will be a top-level `tests` directory, instead of a separate `Tests` directory in each bundle.
35-
So to save you from reconfiguration in the future, it is recommended to place unit, functional, and acceptance test files
34+
It is recommended to place unit, functional, and acceptance test files
3635
into `tests`.
3736

3837
### Project Setup
@@ -129,8 +128,8 @@ class_name: FunctionalTester
129128
modules:
130129
enabled:
131130
- Symfony:
132-
app_path: 'app'
133-
var_path: 'app'
131+
app_path: 'src'
132+
environment: 'test'
134133
- Doctrine2:
135134
depends: Symfony
136135
- \Helper\Functional
@@ -168,8 +167,8 @@ modules:
168167
- \Helper\Api
169168
config:
170169
- Symfony:
171-
app_path: 'app'
172-
var_path: 'app'
170+
app_path: 'src'
171+
environment: 'test'
173172

174173
```
175174

@@ -192,12 +191,6 @@ php bin/codecept g:suite unit
192191

193192
Codeception is powered by PHPUnit so unit and integration test work in a similar manner. To genereate a plain PHPUnit test for `Foo` class, run:
194193

195-
```
196-
php bin/codecept g:phpunit unit Foo
197-
```
198-
199-
This generates a standard test inherited from `PHPUnit_Framework_TestCase`. For integration tests you may use Codeception-enhanced format which allows accessing services DI container, Doctrine, and others. You will need to enable Doctrine2 and Symfony module in `unit.suite.yml` config. Such integration test is extending `Codeception\Test\Unit` class and created by running:
200-
201194
```
202195
php bin/codecept g:test unit Foo
203196
```

0 commit comments

Comments
 (0)