Skip to content

Commit 6290e13

Browse files
committed
updated docs
1 parent 95643a9 commit 6290e13

28 files changed

Lines changed: 138 additions & 212 deletions

RoboFile.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,12 +225,9 @@ public function buildDocsUtils()
225225
->docClass($className)
226226
->processMethod(function(ReflectionMethod $r, $text) use ($utilName) {
227227
$line = $r->getStartLine();
228-
$modifiers = implode(' ', \Reflection::getModifierNames($r->getModifiers()));
229-
$title = "\n#### *$modifiers* {$r->name}";
230-
231228
$text = preg_replace("~@(.*?)([$\s])~",' * `$1` $2', $text);
232229
$text .= "\n[See source](https://github.com/Codeception/Codeception/blob/master/src/Codeception/Util/$utilName.php#L$line)";
233-
return $title.$text;
230+
return $text;
234231
})
235232
->reorderMethods('ksort')
236233
->run();

docs/reference/commands.md

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
Create new test suite. Requires suite name and actor name
99

10-
`codecept g:suite api Api` -> api + ApiGuy
11-
`codecept g:suite frontend Front` -> frontend + FrontGuy
10+
* `codecept g:suite api Api` -> api + ApiGuy
11+
* `codecept g:suite frontend Front` -> frontend + FrontGuy
1212

1313

1414

@@ -59,7 +59,7 @@ Create new test suite. Requires suite name and actor name
5959

6060
Try to execute test commands in run-time. You may try commands before writing the test.
6161

62-
`codecept console acceptance` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
62+
* `codecept console acceptance` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
6363

6464

6565

@@ -105,7 +105,7 @@ Try to execute test commands in run-time. You may try commands before writing th
105105

106106
Creates empty Group file - extension which handles all group events.
107107

108-
`codecept g:group Admin`
108+
* `codecept g:group Admin`
109109

110110

111111

@@ -156,9 +156,9 @@ Creates empty Group file - extension which handles all group events.
156156

157157
Generates Cept (scenario-driven test) file:
158158

159-
`codecept generate:cept suite Login`
160-
`codecept g:cept suite subdir/subdir/testnameCept.php`
161-
`codecept g:cept suite LoginCept -c path/to/project`
159+
* `codecept generate:cept suite Login`
160+
* `codecept g:cept suite subdir/subdir/testnameCept.php`
161+
* `codecept g:cept suite LoginCept -c path/to/project`
162162

163163

164164

@@ -209,6 +209,7 @@ Generates Cept (scenario-driven test) file:
209209

210210
Executes tests.
211211

212+
```
212213
Arguments:
213214
suite suite to be tested
214215
test test to be run
@@ -289,7 +290,7 @@ Options:
289290

290291
Auto-updates phar archive from official site: 'http://codeception.com/codecept.phar' .
291292

292-
`php codecept.phar self-update`
293+
* `php codecept.phar self-update`
293294

294295
@author Franck Cassedanne <franck@cassedanne.com>
295296

@@ -337,8 +338,8 @@ Auto-updates phar archive from official site: 'http://codeception.com/codecept.p
337338

338339
Generates skeleton for Unit Test that extends `Codeception\TestCase\Test`.
339340

340-
`codecept g:test unit User`
341-
`codecept g:test unit "App\User"`
341+
* `codecept g:test unit User`
342+
* `codecept g:test unit "App\User"`
342343

343344

344345

@@ -390,8 +391,8 @@ Generates skeleton for Unit Test that extends `Codeception\TestCase\Test`.
390391
Generates Actor classes (initially Guy classes) from suite configs.
391392
Starting from Codeception 2.0 actor classes are auto-generated. Use this command to generate them manually.
392393

393-
`codecept build`
394-
`codecept build path/to/project`
394+
* `codecept build`
395+
* `codecept build path/to/project`
395396

396397

397398

@@ -443,7 +444,7 @@ Starting from Codeception 2.0 actor classes are auto-generated. Use this command
443444

444445
Creates empty Helper class.
445446

446-
`codecept g:helper MyHelper`
447+
* `codecept g:helper MyHelper`
447448

448449

449450

@@ -546,9 +547,9 @@ You will be asked to choose one of the actors that will be used in tests. To ski
546547

547548
Generates skeleton for unit test as in classical PHPUnit.
548549

549-
`codecept g:phpunit unit UserTest`
550-
`codecept g:phpunit unit User`
551-
`codecept g:phpunit unit "App\User"`
550+
* `codecept g:phpunit unit UserTest`
551+
* `codecept g:phpunit unit User`
552+
* `codecept g:phpunit unit "App\User`
552553

553554

554555

@@ -600,10 +601,9 @@ Generates skeleton for unit test as in classical PHPUnit.
600601

601602
Generates user-friendly text scenarios from scenario-driven tests (Cest, Cept).
602603

603-
`codecept g:scenarios acceptance` - for all acceptance tests
604-
`codecept g:scenarios acceptance --format html` - in html format
605-
`codecept g:scenarios acceptance --path doc` - generate scenarios to `doc` dir
606-
604+
* `codecept g:scenarios acceptance` - for all acceptance tests
605+
* `codecept g:scenarios acceptance --format html` - in html format
606+
* `codecept g:scenarios acceptance --path doc` - generate scenarios to `doc` dir
607607

608608

609609

@@ -658,8 +658,8 @@ Generates user-friendly text scenarios from scenario-driven tests (Cest, Cept).
658658

659659
Generates StepObject class. You will be asked for steps you want to implement.
660660

661-
`codecept g:step acceptance AdminSteps`
662-
`codecept g:step acceptance UserSteps --silent` - skip action questions
661+
* `codecept g:step acceptance AdminSteps`
662+
* `codecept g:step acceptance UserSteps --silent` - skip action questions
663663

664664

665665

@@ -710,8 +710,9 @@ Generates StepObject class. You will be asked for steps you want to implement.
710710
* *Uses* `Codeception\Command\Shared\Config`
711711

712712
Cleans `log` directory
713-
`codecept clean`
714-
`codecept clean -c path/to/project`
713+
714+
* `codecept clean`
715+
* `codecept clean -c path/to/project`
715716

716717

717718

@@ -756,10 +757,10 @@ Cleans `log` directory
756757

757758
Generates Cest (scenario-driven object-oriented test) file:
758759

759-
`codecept generate:cest suite Login`
760-
`codecept g:cest suite subdir/subdir/testnameCest.php`
761-
`codecept g:cest suite LoginCest -c path/to/project`
762-
`codecept g:cest "App\Login"`
760+
* `codecept generate:cest suite Login`
761+
* `codecept g:cest suite subdir/subdir/testnameCest.php`
762+
* `codecept g:cest suite LoginCest -c path/to/project`
763+
* `codecept g:cest "App\Login"`
763764

764765

765766

@@ -812,9 +813,9 @@ Generates Cest (scenario-driven object-oriented test) file:
812813
Generates PageObject. Can be generated either globally, or just for one suite.
813814
If PageObject is generated globally it will act as UIMap, without any logic in it.
814815

815-
`codecept g:page Login`
816-
`codecept g:page Registration`
817-
`codecept g:page acceptance Login`
816+
* `codecept g:page Login`
817+
* `codecept g:page Registration`
818+
* `codecept g:page acceptance Login`
818819

819820

820821

docs/utils/Annotation.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ Simple annotation parser. Take only key-value annotations for methods or class.
88

99

1010

11-
12-
#### *public static* forClass#### *public static* forClass($class) Grabs annotation values.
11+
#### *public static* forClass($class) Grabs annotation values.
1312

1413
Usage example:
1514

@@ -26,25 +25,20 @@ Annotation::forClass('MyTestCase')->method('testData')->fetchAll('depends');
2625

2726
* `return` $this
2827
[See source](https://github.com/Codeception/Codeception/blob/master/src/Codeception/Util/Annotation.php#L39)
29-
30-
#### *public static* forMethod#### *public static* forMethod($class, $method) * `param` $class
28+
#### *public static* forMethod($class, $method) * `param` $class
3129
* `param` $method
3230

3331
* `return` $this
3432
[See source](https://github.com/Codeception/Codeception/blob/master/src/Codeception/Util/Annotation.php#L58)
35-
36-
#### *public* __construct#### *public* __construct($class)
33+
#### *public* __construct($class)
3734
[See source](https://github.com/Codeception/Codeception/blob/master/src/Codeception/Util/Annotation.php#L63)
38-
39-
#### *public* method#### *public* method($method) * `param` $method
35+
#### *public* method($method) * `param` $method
4036

4137
* `return` $this
4238
[See source](https://github.com/Codeception/Codeception/blob/master/src/Codeception/Util/Annotation.php#L73)
43-
44-
#### *public* fetch#### *public* fetch($annotation) * `param` $annotation
39+
#### *public* fetch($annotation) * `param` $annotation
4540
* `return` null
4641
[See source](https://github.com/Codeception/Codeception/blob/master/src/Codeception/Util/Annotation.php#L83)
47-
48-
#### *public* fetchAll#### *public* fetchAll($annotation) * `param` $annotation
42+
#### *public* fetchAll($annotation) * `param` $annotation
4943
* `return` array
5044
[See source](https://github.com/Codeception/Codeception/blob/master/src/Codeception/Util/Annotation.php#L96)

docs/utils/Autoload.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
Custom autoloader to load classes by suffixes: `Helper`, `Page`, `Step`, etc.
77

88

9-
10-
#### *public static* register#### *public static* register($namespace, $suffix, $path) A very basic yet useful autoloader, not compatible with PSR-0.
9+
#### *public static* register($namespace, $suffix, $path) A very basic yet useful autoloader, not compatible with PSR-0.
1110
It is used to autoload classes by namespaces with suffixes.
1211

1312
Example:
@@ -26,18 +25,15 @@ Autoload::register('app\tests','Controller', __DIR__.'/controllers/');
2625
* `param` $suffix
2726
* `param` $path
2827
[See source](https://github.com/Codeception/Codeception/blob/master/src/Codeception/Util/Autoload.php#L34)
29-
30-
#### *public static* registerSuffix#### *public static* registerSuffix($suffix, $path) Shortcut for { * `link` self::register} for classes with empty namespaces.
28+
#### *public static* registerSuffix($suffix, $path) Shortcut for { * `link` self::register} for classes with empty namespaces.
3129

3230
* `param` $suffix
3331
* `param` $path
3432
[See source](https://github.com/Codeception/Codeception/blob/master/src/Codeception/Util/Autoload.php#L49)
35-
36-
#### *public static* load#### *public static* load($class) * `param` $class
33+
#### *public static* load($class) * `param` $class
3734
* `return` bool
3835
[See source](https://github.com/Codeception/Codeception/blob/master/src/Codeception/Util/Autoload.php#L58)
39-
40-
#### *public static* matches#### *public static* matches($class, $namespace, $suffix) *is public for testing purposes*
36+
#### *public static* matches($class, $namespace, $suffix) *is public for testing purposes*
4137

4238
* `param` $class
4339
* `param` $namespace

docs/utils/Debug.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,11 @@
55

66
This class is used only when Codeception is executed in `--debug` mode.
77
In other cases method of this class won't be seen.
8-
9-
#### *public static* setOutput#### *public static* setOutput($output)
8+
#### *public static* setOutput($output)
109
[See source](https://github.com/Codeception/Codeception/blob/master/src/Codeception/Util/Debug.php#L18)
11-
12-
#### *public static* debug#### *public static* debug($message) Prints data to screen. Message can be any time of data
10+
#### *public static* debug($message) Prints data to screen. Message can be any time of data
1311

1412
* `param` $message
1513
[See source](https://github.com/Codeception/Codeception/blob/master/src/Codeception/Util/Debug.php#L28)
16-
17-
#### *public static* pause#### *public static* pause() Pauses execution and waits for user input to proceed.
14+
#### *public static* pause() Pauses execution and waits for user input to proceed.
1815
[See source](https://github.com/Codeception/Codeception/blob/master/src/Codeception/Util/Debug.php#L39)

docs/utils/FileSystem.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@
44

55

66
Set of functions to work with filesystem
7-
8-
#### *public static* doEmptyDir#### *public static* doEmptyDir($path) * `param` $path
7+
#### *public static* doEmptyDir($path) * `param` $path
98
[See source](https://github.com/Codeception/Codeception/blob/master/src/Codeception/Util/FileSystem.php#L13)
10-
11-
#### *public static* deleteDir#### *public static* deleteDir($dir) * `param` $dir
9+
#### *public static* deleteDir($dir) * `param` $dir
1210
* `return` bool
1311
[See source](https://github.com/Codeception/Codeception/blob/master/src/Codeception/Util/FileSystem.php#L39)
14-
15-
#### *public static* copyDir#### *public static* copyDir($src, $dst) * `param` $src
12+
#### *public static* copyDir($src, $dst) * `param` $src
1613
* `param` $dst
1714
[See source](https://github.com/Codeception/Codeception/blob/master/src/Codeception/Util/FileSystem.php#L69)

docs/utils/Fixtures.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,9 @@ Fixtures::get('user1');
1313
?>
1414
```
1515

16-
17-
#### *public static* add#### *public static* add($name, $data)
16+
#### *public static* add($name, $data)
1817
[See source](https://github.com/Codeception/Codeception/blob/master/src/Codeception/Util/Fixtures.php#L21)
19-
20-
#### *public static* get#### *public static* get($name)
18+
#### *public static* get($name)
2119
[See source](https://github.com/Codeception/Codeception/blob/master/src/Codeception/Util/Fixtures.php#L26)
22-
23-
#### *public static* cleanup#### *public static* cleanup()
20+
#### *public static* cleanup()
2421
[See source](https://github.com/Codeception/Codeception/blob/master/src/Codeception/Util/Fixtures.php#L35)

docs/utils/Locator.md

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
Set of useful functions for using CSS and XPath locators.
77
Please check them before writing complex functional or acceptance tests.
88

9-
10-
#### *public static* combine#### *public static* combine($selector1, $selector2) Applies OR operator to any number of CSS or XPath selectors.
9+
#### *public static* combine($selector1, $selector2) Applies OR operator to any number of CSS or XPath selectors.
1110
You can mix up CSS and XPath selectors here.
1211

1312
```php
@@ -36,8 +35,7 @@ As a result the Locator will produce a mixed XPath value that will be used in fi
3635
* `throws` \Exception
3736
* `return` string
3837
[See source](https://github.com/Codeception/Codeception/blob/master/src/Codeception/Util/Locator.php#L46)
39-
40-
#### *public static* href#### *public static* href($url) Matches the *a* element with given URL
38+
#### *public static* href($url) Matches the *a* element with given URL
4139

4240
```php
4341
<?php
@@ -51,8 +49,7 @@ $I->see('Log In', Locator::href('/login.php'));
5149
* `param` $url
5250
* `return` string
5351
[See source](https://github.com/Codeception/Codeception/blob/master/src/Codeception/Util/Locator.php#L73)
54-
55-
#### *public static* tabIndex#### *public static* tabIndex($index) Matches the element with given tab index
52+
#### *public static* tabIndex($index) Matches the element with given tab index
5653

5754
Do you often use the `TAB` key to navigate through the web page? How do your site respond to this navigation?
5855
You could try to match elements by their tab position using `tabIndex` method of `Locator` class.
@@ -70,16 +67,14 @@ $I->click('Login');
7067
* `param` $index
7168
* `return` string
7269
[See source](https://github.com/Codeception/Codeception/blob/master/src/Codeception/Util/Locator.php#L97)
73-
74-
#### *public static* option#### *public static* option($value) Matches option by text
70+
#### *public static* option($value) Matches option by text
7571

7672
* `param` $value
7773

7874
* `return` string
7975
[See source](https://github.com/Codeception/Codeception/blob/master/src/Codeception/Util/Locator.php#L109)
8076

81-
82-
#### *public static* find#### *public static* find($element, array $attributes) Finds element by it's attribute(s)
77+
#### *public static* find($element, array $attributes) Finds element by it's attribute(s)
8378

8479
* `static`
8580

@@ -88,16 +83,13 @@ $I->click('Login');
8883

8984
* `return` string
9085
[See source](https://github.com/Codeception/Codeception/blob/master/src/Codeception/Util/Locator.php#L137)
91-
92-
#### *public static* isCSS#### *public static* isCSS($selector) * `param` $selector
86+
#### *public static* isCSS($selector) * `param` $selector
9387
* `return` bool
9488
[See source](https://github.com/Codeception/Codeception/blob/master/src/Codeception/Util/Locator.php#L154)
95-
96-
#### *public static* isXPath#### *public static* isXPath($locator) Checks that locator is an XPath
89+
#### *public static* isXPath($locator) Checks that locator is an XPath
9790

9891
* `param` $locator
9992
* `return` bool
10093
[See source](https://github.com/Codeception/Codeception/blob/master/src/Codeception/Util/Locator.php#L170)
101-
102-
#### *public static* isID#### *public static* isID($id) Checks that string and CSS selector for element by ID
94+
#### *public static* isID($id) Checks that string and CSS selector for element by ID
10395
[See source](https://github.com/Codeception/Codeception/blob/master/src/Codeception/Util/Locator.php#L181)

0 commit comments

Comments
 (0)