Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/4.x/AcceptanceTests.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ you can pass instance `\Codeception\Step\Argument\PasswordArgument` with the dat
{% highlight php %}

<?php
use \Codeception\Step\Argument\PasswordArgument;
use Codeception\Step\Argument\PasswordArgument;

$I->amOnPage('/form/password_argument');
$I->fillField('password', new PasswordArgument('thisissecret'));
Expand Down
2 changes: 1 addition & 1 deletion docs/4.x/Customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ The extension class itself is inherited from `Codeception\Extension`:
{% highlight php %}

<?php
use \Codeception\Events;
use Codeception\Events;

class MyCustomExtension extends \Codeception\Extension
{
Expand Down
2 changes: 1 addition & 1 deletion docs/AcceptanceTests.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ If you need to fill in sensitive data (like passwords) and hide it in logs,
you can pass instance `\Codeception\Step\Argument\PasswordArgument` with the data which needs to be hidden.

```php
use \Codeception\Step\Argument\PasswordArgument;
use Codeception\Step\Argument\PasswordArgument;

$I->amOnPage('/form/password_argument');
$I->fillField('password', new PasswordArgument('thisissecret'));
Expand Down
37 changes: 18 additions & 19 deletions docs/AdvancedUsage.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ As you see, we are passing the Actor object into `tryToTest` method. This allows
<?php
namespace Tests\Acceptance;

use \Tests\Support\AcceptanceTester;
use Tests\Support\AcceptanceTester;

class BasicCest
{
Expand Down Expand Up @@ -104,8 +104,8 @@ namespace Tests\Acceptance;
use Codeception\Attribute\Skip;
use Codeception\Scenario;

class UserCest {

class UserCest
{
#[Skip]
public function notImportantTest(AcceptanceTester $I)
{
Expand Down Expand Up @@ -210,8 +210,8 @@ namespace Tests\Acceptance;
use Codeception\Attribute\Group;
use Tests\Support\AcceptanceTester

class UserCest {

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

use \Tests\Support\ApiTester;
use \Codeception\Attribute\Examples;
use \Codeception\Example;
use Codeception\Attribute\Examples;
use Codeception\Example;
use Tests\Support\ApiTester;

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

namespace Tests\Api;

use \Tests\Support\ApiTester;
use \Codeception\Attribute\Examples;
use \Codeception\Example;
use Codeception\Attribute\Examples;
use Codeception\Example;
use Tests\Support\ApiTester;

class EndpointCest
{
Expand Down Expand Up @@ -317,8 +317,8 @@ You can also use the `@dataProvider` annotation for creating dynamic examples fo
<?php
namespace Tests\Acceptance;

use \Codeception\Attribute\DataProvider;
use \Codeception\Example;
use Codeception\Attribute\DataProvider;
use Codeception\Example;

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

use \Tests\Support\FunctionalTester;
use Codeception\Attribute\Before;
use Codeception\Attribute\After;
use Tests\Support\FunctionalTester;

class ModeratorCest {

class ModeratorCest
{
protected function login(AcceptanceTester $I)
{
$I->amOnPage('/login');
Expand Down Expand Up @@ -398,8 +398,8 @@ namespace Tests\Acceptance;

use Codeception\Attribute\Depends;

class ModeratorCest {

class ModeratorCest
{
public function login(AcceptanceTester $I)
{
// logs moderator in
Expand All @@ -425,7 +425,6 @@ Signature: ModeratorCest:login`

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


## Environments

For cases where you need to run tests with different configurations, you can define different config environments.
Expand Down
2 changes: 1 addition & 1 deletion docs/Customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ The extension class itself is inherited from `Codeception\Extension`:

```php
<?php
use \Codeception\Events;
use Codeception\Events;

class MyCustomExtension extends \Codeception\Extension
{
Expand Down
2 changes: 1 addition & 1 deletion docs/FunctionalTests.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This is a sample functional test:

namespace Tests\Functional;

use \Tests\Support\FunctionalTester;
use Tests\Support\FunctionalTester;

class LoginCest
{
Expand Down
4 changes: 2 additions & 2 deletions docs/ReusingTestCode.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ In the case of a PageObject you should declare a class as a parameter for a test

namespace Tests\Acceptance;

use \Tests\Support\AcceptanceTester;
use \Tests\Support\Page\Acceptance\Login;
use Tests\Support\AcceptanceTester;
use Tests\Support\Page\Acceptance\Login;

class UserCest
{
Expand Down
6 changes: 3 additions & 3 deletions docs/UnitTests.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ A test created by the `generate:test` command will look like this:

namespace Tests\Unit;

use \Tests\Support\UnitTester;
use Tests\Support\UnitTester;

class ExampleTest extends \Codeception\Test\Unit
{
Expand Down Expand Up @@ -76,7 +76,7 @@ A typical unit test may look like this:

namespace Tests\Unit;

use \Tests\Support\UnitTester;
use Tests\Support\UnitTester;

class UserTest extends \Codeception\Test\Unit
{
Expand Down Expand Up @@ -403,7 +403,7 @@ For this case we have a stand-alone project [Specify](https://github.com/Codecep

namespace Tests\Unit;

use \Tests\Support\UnitTester;
use Tests\Support\UnitTester;

class UserTest extends \Codeception\Test\Unit
{
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/HttpCode.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Usage:
{% highlight php %}

<?php
use \Codeception\Util\HttpCode;
use Codeception\Util\HttpCode;

// using REST, PhpBrowser, or any Framework module
$I->seeResponseCodeIs(HttpCode::OK);
Expand Down
10 changes: 5 additions & 5 deletions docs/reference/Locator.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ You can mix up CSS and XPath selectors here.
{% highlight php %}

<?php
use \Codeception\Util\Locator;
use Codeception\Util\Locator;

$I->see('Title', Locator::combine('h1','h2','h3'));

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

<?php
use \Codeception\Util\Locator;
use Codeception\Util\Locator;

$I->fillField(Locator::combine('form input[type=text]','//form/textarea[2]'), 'qwerty');

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

<?php
use \Codeception\Util\Locator;
use Codeception\Util\Locator;

$I->seeElement(Locator::find('img', ['title' => 'diagram']));

Expand Down Expand Up @@ -167,7 +167,7 @@ Matches the *a* element with given URL
{% highlight php %}

<?php
use \Codeception\Util\Locator;
use Codeception\Util\Locator;

$I->see('Log In', Locator::href('/login.php'));

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

<?php
use \Codeception\Util\Locator;
use Codeception\Util\Locator;

$I->fillField(Locator::tabIndex(1), 'davert');
$I->fillField(Locator::tabIndex(2) , 'qwerty');
Expand Down
10 changes: 5 additions & 5 deletions docs/reference/Mock.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ exception.
{% highlight php %}

<?php
use \Codeception\Stub\Expected;
use Codeception\Stub\Expected;

$user = $this->make('User', [
'getName' => Expected::never(),
Expand All @@ -316,7 +316,7 @@ exception.
{% highlight php %}

<?php
use \Codeception\Stub\Expected;
use Codeception\Stub\Expected;

$user = $this->make(
'User',
Expand Down Expand Up @@ -351,7 +351,7 @@ If the number of invocations is 0 it will throw an exception in verify.
{% highlight php %}

<?php
use \Codeception\Stub\Expected;
use Codeception\Stub\Expected;

$user = $this->make(
'User',
Expand Down Expand Up @@ -392,8 +392,8 @@ exception.
{% highlight php %}

<?php
use \Codeception\Stub;
use \Codeception\Stub\Expected;
use Codeception\Stub;
use Codeception\Stub\Expected;

$user = $this->make(
'User',
Expand Down