@@ -89,19 +89,18 @@ public function testValidation()
8989}
9090```
9191
92- ## Purpose
92+ ## Use Case
9393
94- This tiny library makes your tests a bit readable, by organizing test in well described code blocks.
95- Each code block is isolated.
94+ This tiny library makes your tests readable by organizing them in nested code blocks.
95+ This allows to combine similar tests into one but put them inside nested sections.
9696
97- This means call to ` $this->specify ` does not change values of properties of a test class.
98- Isolated properties should be marked with ` @specify ` annotation.
97+ This is very similar to BDD syntax as in RSpec or Mocha but works inside PHPUnit:
9998
10099``` php
101100<?php
102- class UserTest extends PHPUnit\Framework\TestCase {
103-
104- use Codeception\Specify;
101+ class UserTest extends PHPUnit\Framework\TestCase
102+ {
103+ use Codeception\Specify;
105104
106105 /** @specify */
107106 protected $user; // is cloned inside specify blocks
@@ -120,10 +119,13 @@ class UserTest extends PHPUnit\Framework\TestCase {
120119 });
121120 // user name is davert again
122121 $this->assertEquals('davert', $this->user->name);
123- }
122+ }
124123}
125124```
126125
126+ Each code block is isolated. This means call to ` $this->specify ` does not change values of properties of a test class.
127+ Isolated properties should be marked with ` @specify ` annotation.
128+
127129Failure in ` specify ` block won't get your test stopped.
128130
129131``` php
@@ -180,9 +182,7 @@ $this->specify('this should not fail', function () {
180182});
181183```
182184
183- ## Examples
184-
185- DataProviders alternative
185+ ## Examples: DataProviders alternative
186186
187187``` php
188188<?php
0 commit comments