File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 1- 0.4.0
1+ 0.4.1
You can’t perform that action at this time.
0 commit comments