Skip to content

Commit 0c0ae07

Browse files
committed
updated readme
1 parent c7e7b3b commit 0c0ae07

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,35 @@ class UserTest extends \PHPUnit_Framework_TestCase
118118
}
119119
```
120120

121+
Only specific properties can be preserved in specify blocks:
122+
123+
```php
124+
<?php
125+
class UserTest extends \PHPUnit_Framework_TestCase
126+
{
127+
use Codeception\Specify;
128+
protected $user;
129+
protected $post;
130+
131+
function testUser()
132+
{
133+
$this->user = 'davert';
134+
$this->post = 'hello world';
135+
136+
$this->specifyConfig()
137+
->cloneOnly('user');
138+
139+
$this->specify('post is not cloned', function() {
140+
$this->user = 'john';
141+
$this->post = 'bye world';
142+
});
143+
$this->assertEquals('davert', $this->user); // user is restored
144+
$this->assertEquals('bye world', $this->post); // post was not stored
145+
}
146+
}
147+
```
148+
149+
121150
[Reference](https://github.com/Codeception/Specify/blob/master/docs/LocalConfig.md)
122151

123152

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.4.0
1+
0.4.1

0 commit comments

Comments
 (0)