PHP code example of themeplate / tester
1. Go to this page and download the library: Download themeplate/tester 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/ */
themeplate / tester example snippets
namespace Tests;
use ThemePlate\Tester\Utils;
class SampleTest extends WP_UnitTestCase {
public function test_sample() {
$instance = new Class();
Utils::invoke_inaccessible_method( $instance, 'method_name', array( 'arg1', 'arg2' ) );
$value = Utils::get_inaccessible_property( $instance, 'property_name' );
Utils::set_inaccessible_property( $instance, 'wanted_property', $value );
// Do actual assertions
}
}