Skip to content

Commit bfd326d

Browse files
committed
updated guides
1 parent a017c42 commit bfd326d

File tree

6 files changed

+492
-633
lines changed

6 files changed

+492
-633
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## Shell auto-completion
2+
3+
For bash and zsh shells, you can use auto-completion for your Codeception projects by executing the following in your shell (or add it to your .bashrc/.zshrc):
4+
5+
```
6+
# BASH ~4.x, ZSH
7+
source <([codecept location] _completion --generate-hook --program codecept --use-vendor-bin)
8+
# BASH ~3.x, ZSH
9+
[codecept location] _completion --generate-hook --program codecept --use-vendor-bin | source /dev/stdin
10+
11+
# BASH (any version)
12+
eval $([codecept location] _completion --generate-hook --program codecept --use-vendor-bin)
13+
14+
```
15+
16+
By using the above code in your shell, Codeception will try to autocomplete the following:
17+
18+
* Commands
19+
* Suites
20+
* Test paths
21+
22+
Usage of `-use-vendor-bin` is optional. This option will work for most Codeception projects, where Codeception is located in your `vendor/bin` folder.
23+
But in case you are using a global Codeception installation for example, you wouldn't use this option.
24+
25+
Note that with the `-use-vendor-bin` option, your commands will be completed using the Codeception binary located in your project's root.
26+
Without the option, it will use whatever Codeception binary you originally used to generate the completion script ('codecept location' in the above examples)

guides/06-ModulesAndHelpers.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,6 @@ To display additional information, use the `debug` and `debugSection` methods of
329329
Here is an example of how it works for PhpBrowser:
330330

331331
```php
332-
333-
<?php
334332
$this->debugSection('Request', $params);
335333
$this->client->request($method, $uri, $params);
336334
$this->debug('Response Code: ' . $this->client->getStatusCode());

guides/06-ReusingTestCode.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ Let's see what's inside the `AcceptanceTester` class, which is located inside th
4040
<?php
4141
4242
declare(strict_types=1);
43+
4344
namespace Tests\Support;
45+
4446
/**
4547
* Inherited Methods
4648
* @method void wantToTest($text)
@@ -120,6 +122,8 @@ Let's define a `login` method in this class:
120122
```php
121123
namespace Tests\Support\Page\Acceptance;
122124
125+
use Tests\Support\AcceptanceTester;
126+
123127
class Login
124128
{
125129
public static $URL = '/login';
@@ -131,7 +135,7 @@ class Login
131135
protected AcceptanceTester $tester;
132136
133137
// we inject AcceptanceTester into our class
134-
public function __construct(\AcceptanceTester $I)
138+
public function __construct(AcceptanceTester $I)
135139
{
136140
$this->tester = $I;
137141
}
@@ -223,6 +227,7 @@ The `loginAsAdmin` method may be implemented like this:
223227

224228
```php
225229
<?php
230+
226231
namespace Tests\Support\Step\Acceptance;
227232

228233
use Tests\Support\AcceptanceTester;

0 commit comments

Comments
 (0)