PHP code example of iambrianreich / wordpress-testcase

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

    

iambrianreich / wordpress-testcase example snippets




/**
 * Tests my plugin!
 *
 * Assumes you've correctly setup WordPress PHPUnit tests using WP-CLI so
 * when this TestCase is executed, your plugin has already run and registered
 * all of it's customizations with WordPress core.
 */
class MyPluginTest extends BR\WordPress\TestCase\PHPUnit\TestCase {

    public function testRegistersTheWidgetsPostType() {
        $this->assertPostTypeExists('widgets');
    }
}