You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Functional tests allow test application by simulating user actions, this is done by sending requests to framework kernel and checking HTML as a result. Unilke internal tests of Laravel, Codeception doesn't limit you to testing only one request per test. You can **test complex interactions involving different actions and controllers**. This way you can easily cover your specifictions with functional tests.
48
48
49
-
To start you need to configure `tests/functional.suite.yml` to use Laravel5 module:
49
+
To start you need to configure `tests/functional.suite.yml` to use Laravel module:
50
50
51
51
```yaml
52
52
class_name: FunctionalTester
53
53
modules:
54
54
enabled:
55
-
- Laravel5:
55
+
- Laravel:
56
56
environment_file: .env.testing
57
57
- \AppBundle\Helper\Functional
58
58
```
@@ -63,7 +63,7 @@ modules:
63
63
Continue to <a href="http://codeception.com/docs/04-FunctionalTests">Functional Testing Guide »</a>
64
64
</div>
65
65
66
-
Codeception will also use **Eloquent to cleanup changes to database** by wrapping tests into transaction and rolling it back in the end of a test. This makes tests isolated and fast. Laravel5 module allows to access services from DIC container, user authentication methods, fixture generators, check form validations and more.
66
+
Codeception will also use **Eloquent to cleanup changes to database** by wrapping tests into transaction and rolling it back in the end of a test. This makes tests isolated and fast. Laravel module allows to access services from DIC container, user authentication methods, fixture generators, check form validations and more.
67
67
68
68
To create first functional test for `Login` you should run:
69
69
@@ -79,7 +79,7 @@ Codeception is powered by PHPUnit so unit and integration test work in a similar
79
79
php vendor/bin/codecept g:test unit "Foo\Bar"
80
80
```
81
81
This generates `Codeception\Test\Unit` testcase which is inherited from PHPUnit but provides a module access.
82
-
Enable Laravel5 module in `unit.suite.yml` to have its methods inside a testcase. They are available injected into `$this->tester` property of a testcase.
82
+
Enable Laravel module in `unit.suite.yml` to have its methods inside a testcase. They are available injected into `$this->tester` property of a testcase.
@@ -105,7 +105,7 @@ Browser can be specified as `firefox`, `chrome`, or others.
105
105
106
106
Acceptance tests will be executed in development environment using real web server, so settings from `.env.testing` can't be passed to them.
107
107
108
-
You can also use Eloquent to create data for acceptance tests. This way you can use data factories and models to prepare and cleanup data for tests. You should enable Laravel5 module with ORM part to add ActiveRecord methods:
108
+
You can also use Eloquent to create data for acceptance tests. This way you can use data factories and models to prepare and cleanup data for tests. You should enable Laravel module with ORM part to add ActiveRecord methods:
109
109
110
110
```yaml
111
111
class_name: AcceptanceTester
@@ -114,13 +114,13 @@ modules:
114
114
- WebDriver:
115
115
url: 'https://localhost/'# put your local url
116
116
browser: firefox
117
-
- Laravel5:
117
+
- Laravel:
118
118
part: ORM
119
119
cleanup: false # can't wrap into transaction
120
120
- \Helper\Acceptance
121
121
```
122
122
123
-
Laravel5 module won't be able to wrap test execution in a transaction but methods like `haveRecord` or `haveModel` will delete objects they created when test ends.
123
+
Laravel module won't be able to wrap test execution in a transaction but methods like `haveRecord` or `haveModel` will delete objects they created when test ends.
124
124
125
125
### API Tests
126
126
@@ -130,23 +130,23 @@ API Tests are done at functional testing level but instead of testing HTML respo
130
130
php vendor/bin/codecept g:suite api
131
131
```
132
132
133
-
You will need to enable `REST`, `Laravel5` module in `tests/api.suite.yml`:
133
+
You will need to enable `REST`, `Laravel` module in `tests/api.suite.yml`:
134
134
135
135
```yaml
136
136
class_name: ApiTester
137
137
modules:
138
138
enabled:
139
139
- REST:
140
140
url: /api/v1
141
-
depends: Laravel5
141
+
depends: Laravel
142
142
- \Helper\Api
143
143
config:
144
-
- Laravel5:
144
+
- Laravel:
145
145
environment_file: .env.testing
146
146
147
147
```
148
148
149
-
Laravel5 module actions like `amOnPage` or `see` should not be available for testing API. This why Laravel5 module is not enabled but declared with `depends` for REST module. Laravel5 should use testing environment which is specified in `config` section
149
+
Laravel module actions like `amOnPage` or `see` should not be available for testing API. This why Laravel module is not enabled but declared with `depends` for REST module. Laravel should use testing environment which is specified in `config` section
0 commit comments