Skip to content

Commit ff68bff

Browse files
committed
updated readme
1 parent 953b7d9 commit ff68bff

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,4 +166,45 @@ Install with Composer:
166166
```
167167
Include `Codeception\Specifiy` trait into your test.
168168

169+
## Configuration
170+
171+
Specify clones all properties of current testcase for all specify blocks.
172+
By default Specify clones all objects using deep cloning method.
173+
This behavior can be customized in order to speed up test execution by preventing some objects from cloning or switching to shallow cloning using `clone` operator.
174+
175+
### Global
176+
177+
Configation can be set globally
178+
179+
```php
180+
<?php
181+
// globally disabling cloning of properties
182+
Codeception\Specify\Config::setIgnoredProperties(['user', 'repository']);
183+
?>
184+
```
185+
186+
See complete [reference](https://github.com/Codeception/Specify/blob/master/docs/GlobalConfig.md).
187+
188+
### Local
189+
190+
Configuring can be done locally per test case
191+
192+
```php
193+
<?php
194+
class UserTest extends \PHPUnit_Framework_TestCase
195+
{
196+
use Codeception\Specify;
197+
198+
function testUser()
199+
{
200+
// do not deep clone user property
201+
$this->specifyConfig()
202+
->shallowClone('user');
203+
}
204+
}
205+
```
206+
207+
[Reference](https://github.com/Codeception/Specify/blob/master/docs/LocalConfig.md)
208+
209+
169210
License: MIT

0 commit comments

Comments
 (0)