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
Copy file name to clipboardExpand all lines: README.md
+39-16Lines changed: 39 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,15 @@
1
1
BraincraftedTestingBundle
2
2
=========================
3
3
4
-
Handcrafted in Vienna by [Florian Eckerstorfer](http://braincrafted.com).
4
+
Handcrafted in Vienna by [Florian Eckerstorfer](https://florian.ec).
5
5
6
6
7
7
About
8
8
-----
9
9
10
-
This bundle currently provides an abstract class to better isolate functional tests of Symfony2 applications. The `WebTestCase` class drops the schema, recreates it and loads all fixture files. Currently [DoctrineFixturesBundle](https://github.com/doctrine/DoctrineFixturesBundle) is a required dependency of this bundle.
10
+
This bundle currently provides an abstract class to better isolate functional tests of Symfony2 applications. The
11
+
`WebTestCase` class drops the schema, recreates it and loads all fixture files. Currently
12
+
[DoctrineFixturesBundle](https://github.com/doctrine/DoctrineFixturesBundle) is a required dependency of this bundle.
11
13
12
14
At some point this bundle may contain other useful classes, services and helpers related to testing.
13
15
@@ -20,12 +22,15 @@ You need to add bundle to your `composer.json` file:
20
22
```json
21
23
{
22
24
"require-dev": {
23
-
"braincrafted/testing-bundle": "dev-master"
25
+
"braincrafted/testing-bundle": "@stable"
24
26
}
25
27
}
26
28
```
27
29
28
-
The master branch has been updated to be compatible with Symfony 2.3. If you are using Symfony <2.3 you can use the `0.1` branch.
30
+
*Tip: You should replace `@stable` with a specific [version](https://github.com/braincrafted/testing-bundle/releases).*
31
+
32
+
The master branch has been updated to be compatible with Symfony 2.3. If you are using Symfony <2.3 you can use the
33
+
`0.1` branch.
29
34
30
35
```json
31
36
{
@@ -35,7 +40,8 @@ The master branch has been updated to be compatible with Symfony 2.3. If you are
35
40
}
36
41
```
37
42
38
-
Add the bundle to your kernel (only activate the bundle in the dev and test environment, you don't need to have it activated in the production environment):
43
+
Add the bundle to your kernel (only activate the bundle in the dev and test environment, you don't need to have it
44
+
activated in the production environment):
39
45
40
46
```php
41
47
// app/AppKernel.php
@@ -72,7 +78,8 @@ class DemoTest extends WebTestCase
72
78
}
73
79
```
74
80
75
-
By default `WebTestCase` provides a `setUp()` and a `tearDown()` method that boot respectively shut down the kernel. However, if you have your own `setUp()` and/or `tearDown()` methods in your test case you need to manually do this.
81
+
By default `WebTestCase` provides a `setUp()` and a `tearDown()` method that boot respectively shut down the kernel.
82
+
However, if you have your own `setUp()` and/or `tearDown()` methods in your test case you need to manually do this.
The `WebTestCase` class also has an nice helper method that returns the HTML code of a crawler. You can use it in all test cases that subclass `Braincrafted\Bundle\TestingBundle\Test\WebTestCase`:
122
+
The `WebTestCase` class also has an nice helper method that returns the HTML code of a crawler. You can use it in all
123
+
test cases that subclass `Braincrafted\Bundle\TestingBundle\Test\WebTestCase`:
116
124
117
125
```php
118
126
echo $this->renderCrawlerHtml($crawler);
119
127
```
120
128
121
129
### Testing Translation Keys
122
130
123
-
`BraincraftedTestingBundle` installs an alternative translator that is only activated in the `test` environment. This translator returns the translation key instead of the translated text. That way you can use the translation keys in your functional tests instead of the translated text.
131
+
`BraincraftedTestingBundle` installs an alternative translator that is only activated in the `test` environment. This
132
+
translator returns the translation key instead of the translated text. That way you can use the translation keys in your
133
+
functional tests instead of the translated text.
124
134
125
135
126
-
License
127
-
-------
136
+
Change Log
137
+
----------
138
+
139
+
### Version 0.3.1 (25 August 2014)
140
+
141
+
- Fixed type hint for `WebTestCase::createClient()` method
142
+
- Pass `$options` to `WebTestCase::createKernel()` in `WebTestCase::createClient()`
128
143
129
-
### The MIT License (MIT)
130
144
131
-
Copyright (c) 2012-2013 Florian Eckerstorfer
145
+
### Version 0.3 (18 November 2013)
132
146
133
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
147
+
- Changed namespace to `Braincrafted`.
134
148
135
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
136
149
137
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
150
+
License
151
+
-------
152
+
153
+
### The MIT License (MIT)
154
+
155
+
Copyright (c) 2012-2014 Florian Eckerstorfer
138
156
157
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
158
+
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
161
+
Software.
141
162
163
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
164
+
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0 commit comments