PHP code example of alleyinteractive / pest-plugin-wordpress

1. Go to this page and download the library: Download alleyinteractive/pest-plugin-wordpress 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/ */

    

alleyinteractive / pest-plugin-wordpress example snippets


// uses(Tests\TestCase::class)->in('Feature');

uses(\Mantle\Testkit\Test_Case::class)->in(__DIR__);

// Install WordPress via Mantle.
\Mantle\Testing\install();

use function Pest\PestPluginWordPress\from;
use function Pest\PestPluginWordPress\get;

it( 'should load the homepage', function () {
    get( '/' )
        ->assertStatus( 200 )
        ->assertSee( 'home' );
} );

it( 'should load with a referrer', function () {
    from( 'https://laravel.com/' )
        ->get( '/' )
        ->assertStatus( 200 );
});