PHP code example of greys / woocommerce-phpunit-framework
1. Go to this page and download the library: Download greys/woocommerce-phpunit-framework 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/ */
greys / woocommerce-phpunit-framework example snippets
class My_Extension_Test extends WC_Unit_Test_Case {
public function test_product_creation() {
$product = WC_Helper_Product::create_simple_product();
$this->assertInstanceOf('WC_Product', $product);
}
}