PHP code example of 10up / wp-codeception

1. Go to this page and download the library: Download 10up/wp-codeception library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

10up / wp-codeception example snippets




// Make sure you've added your site URL to acceptance.suite.yml
// @see http://codeception.com/docs/03-AcceptanceTests#PHP-Browser
$I = new AcceptanceTester( $scenario );
$I->wantTo( 'Ensure WordPress Login Works' );

// Let's start on the login page
$I->amOnPage( wp_login_url() );

// Populate the login form's user id field
$I->fillField( 'input#user_login', 'YourUsername' );

// Popupate the login form's password field
$I->fillField( 'input#user_pass', 'YourPassword' );

// Submit the login form
$I->click( 'Log In' );

// Validate the successful loading of the Dashboard
$I->see( 'Dashboard' );
Bash
{
    ...,
    "autoload": {
        "psr-X": {
            ...
        },
        "files": [
            ...,
            "vendor/wp-codeception/wp-codeception.php"
        ]
    },
    ...
}