Skip to content

Commit 7003d20

Browse files
authored
Corrected use statements and brace placements. (#895)
1 parent 2a0f9db commit 7003d20

File tree

11 files changed

+39
-40
lines changed

11 files changed

+39
-40
lines changed

docs/4.x/AcceptanceTests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ you can pass instance `\Codeception\Step\Argument\PasswordArgument` with the dat
244244
{% highlight php %}
245245

246246
<?php
247-
use \Codeception\Step\Argument\PasswordArgument;
247+
use Codeception\Step\Argument\PasswordArgument;
248248
249249
$I->amOnPage('/form/password_argument');
250250
$I->fillField('password', new PasswordArgument('thisissecret'));

docs/4.x/Customization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ The extension class itself is inherited from `Codeception\Extension`:
158158
{% highlight php %}
159159

160160
<?php
161-
use \Codeception\Events;
161+
use Codeception\Events;
162162
163163
class MyCustomExtension extends \Codeception\Extension
164164
{

docs/AcceptanceTests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ If you need to fill in sensitive data (like passwords) and hide it in logs,
209209
you can pass instance `\Codeception\Step\Argument\PasswordArgument` with the data which needs to be hidden.
210210

211211
```php
212-
use \Codeception\Step\Argument\PasswordArgument;
212+
use Codeception\Step\Argument\PasswordArgument;
213213

214214
$I->amOnPage('/form/password_argument');
215215
$I->fillField('password', new PasswordArgument('thisissecret'));

docs/AdvancedUsage.md

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ As you see, we are passing the Actor object into `tryToTest` method. This allows
5454
<?php
5555
namespace Tests\Acceptance;
5656

57-
use \Tests\Support\AcceptanceTester;
57+
use Tests\Support\AcceptanceTester;
5858

5959
class BasicCest
6060
{
@@ -104,8 +104,8 @@ namespace Tests\Acceptance;
104104
use Codeception\Attribute\Skip;
105105
use Codeception\Scenario;
106106

107-
class UserCest {
108-
107+
class UserCest
108+
{
109109
#[Skip]
110110
public function notImportantTest(AcceptanceTester $I)
111111
{
@@ -210,8 +210,8 @@ namespace Tests\Acceptance;
210210
use Codeception\Attribute\Group;
211211
use Tests\Support\AcceptanceTester
212212

213-
class UserCest {
214-
213+
class UserCest
214+
{
215215
#[Group('admin')] // set a group for this test
216216
#[Group('slow', 'important')] // add groups in a single attribute
217217
public function testAdminUser(AcceptanceTester $I)
@@ -238,9 +238,9 @@ Data is defined via the `Examples` attribute
238238
<?php
239239
namespace Tests\Api;
240240

241-
use \Tests\Support\ApiTester;
242-
use \Codeception\Attribute\Examples;
243-
use \Codeception\Example;
241+
use Codeception\Attribute\Examples;
242+
use Codeception\Example;
243+
use Tests\Support\ApiTester;
244244

245245
class EndpointCest
246246
{
@@ -263,9 +263,9 @@ You can also use [named arguments](https://www.php.net/manual/en/functions.argum
263263

264264
namespace Tests\Api;
265265

266-
use \Tests\Support\ApiTester;
267-
use \Codeception\Attribute\Examples;
268-
use \Codeception\Example;
266+
use Codeception\Attribute\Examples;
267+
use Codeception\Example;
268+
use Tests\Support\ApiTester;
269269

270270
class EndpointCest
271271
{
@@ -317,8 +317,8 @@ You can also use the `@dataProvider` annotation for creating dynamic examples fo
317317
<?php
318318
namespace Tests\Acceptance;
319319

320-
use \Codeception\Attribute\DataProvider;
321-
use \Codeception\Example;
320+
use Codeception\Attribute\DataProvider;
321+
use Codeception\Example;
322322

323323
class PageCest
324324
{
@@ -352,12 +352,12 @@ When adding multiple `#[Before]` or `#[After]` attributes, methods are invoked i
352352
<?php
353353
namespace Tests\Functional;
354354

355-
use \Tests\Support\FunctionalTester;
356355
use Codeception\Attribute\Before;
357356
use Codeception\Attribute\After;
357+
use Tests\Support\FunctionalTester;
358358

359-
class ModeratorCest {
360-
359+
class ModeratorCest
360+
{
361361
protected function login(AcceptanceTester $I)
362362
{
363363
$I->amOnPage('/login');
@@ -398,8 +398,8 @@ namespace Tests\Acceptance;
398398

399399
use Codeception\Attribute\Depends;
400400

401-
class ModeratorCest {
402-
401+
class ModeratorCest
402+
{
403403
public function login(AcceptanceTester $I)
404404
{
405405
// logs moderator in
@@ -425,7 +425,6 @@ Signature: ModeratorCest:login`
425425

426426
Codeception reorders tests so dependent tests will always be executed before the tests that rely on them.
427427

428-
429428
## Environments
430429

431430
For cases where you need to run tests with different configurations, you can define different config environments.

docs/Customization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ The extension class itself is inherited from `Codeception\Extension`:
147147

148148
```php
149149
<?php
150-
use \Codeception\Events;
150+
use Codeception\Events;
151151
152152
class MyCustomExtension extends \Codeception\Extension
153153
{

docs/FunctionalTests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This is a sample functional test:
2525

2626
namespace Tests\Functional;
2727

28-
use \Tests\Support\FunctionalTester;
28+
use Tests\Support\FunctionalTester;
2929

3030
class LoginCest
3131
{

docs/ReusingTestCode.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ In the case of a PageObject you should declare a class as a parameter for a test
167167
168168
namespace Tests\Acceptance;
169169
170-
use \Tests\Support\AcceptanceTester;
171-
use \Tests\Support\Page\Acceptance\Login;
170+
use Tests\Support\AcceptanceTester;
171+
use Tests\Support\Page\Acceptance\Login;
172172
173173
class UserCest
174174
{

docs/UnitTests.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ A test created by the `generate:test` command will look like this:
4040

4141
namespace Tests\Unit;
4242

43-
use \Tests\Support\UnitTester;
43+
use Tests\Support\UnitTester;
4444

4545
class ExampleTest extends \Codeception\Test\Unit
4646
{
@@ -76,7 +76,7 @@ A typical unit test may look like this:
7676

7777
namespace Tests\Unit;
7878

79-
use \Tests\Support\UnitTester;
79+
use Tests\Support\UnitTester;
8080

8181
class UserTest extends \Codeception\Test\Unit
8282
{
@@ -403,7 +403,7 @@ For this case we have a stand-alone project [Specify](https://github.com/Codecep
403403
404404
namespace Tests\Unit;
405405
406-
use \Tests\Support\UnitTester;
406+
use Tests\Support\UnitTester;
407407
408408
class UserTest extends \Codeception\Test\Unit
409409
{

docs/reference/HttpCode.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Usage:
1616
{% highlight php %}
1717

1818
<?php
19-
use \Codeception\Util\HttpCode;
19+
use Codeception\Util\HttpCode;
2020
2121
// using REST, PhpBrowser, or any Framework module
2222
$I->seeResponseCodeIs(HttpCode::OK);

docs/reference/Locator.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ You can mix up CSS and XPath selectors here.
3131
{% highlight php %}
3232

3333
<?php
34-
use \Codeception\Util\Locator;
34+
use Codeception\Util\Locator;
3535
3636
$I->see('Title', Locator::combine('h1','h2','h3'));
3737

@@ -43,7 +43,7 @@ You can also combine CSS selector with XPath locator:
4343
{% highlight php %}
4444

4545
<?php
46-
use \Codeception\Util\Locator;
46+
use Codeception\Util\Locator;
4747
4848
$I->fillField(Locator::combine('form input[type=text]','//form/textarea[2]'), 'qwerty');
4949

@@ -121,7 +121,7 @@ Finds element by it's attribute(s)
121121
{% highlight php %}
122122

123123
<?php
124-
use \Codeception\Util\Locator;
124+
use Codeception\Util\Locator;
125125
126126
$I->seeElement(Locator::find('img', ['title' => 'diagram']));
127127

@@ -167,7 +167,7 @@ Matches the *a* element with given URL
167167
{% highlight php %}
168168
169169
<?php
170-
use \Codeception\Util\Locator;
170+
use Codeception\Util\Locator;
171171
172172
$I->see('Log In', Locator::href('/login.php'));
173173

@@ -342,7 +342,7 @@ You could try to match elements by their tab position using `tabIndex` method of
342342
{% highlight php %}
343343

344344
<?php
345-
use \Codeception\Util\Locator;
345+
use Codeception\Util\Locator;
346346
347347
$I->fillField(Locator::tabIndex(1), 'davert');
348348
$I->fillField(Locator::tabIndex(2) , 'qwerty');

0 commit comments

Comments
 (0)