Merge pull request #17076 from woocommerce/fix/orders-meta-test

Test fixes for meta and installer
This commit is contained in:
Claudio Sanches 2017-10-05 15:14:00 -03:00 committed by GitHub
commit e9a62731d4
2 changed files with 7 additions and 6 deletions

View File

@ -96,10 +96,10 @@ class WC_Tests_API_Orders extends WC_REST_Unit_Test_Case {
$this->assertEquals( $order->get_id(), $data['id'] );
// Test meta data is set.
$this->assertEquals( 'key', $data['meta_data'][0]['key'] );
$this->assertEquals( 'value', $data['meta_data'][0]['value'] );
$this->assertEquals( 'key2', $data['meta_data'][1]['key'] );
$this->assertEquals( 'value2', $data['meta_data'][1]['value'] );
$this->assertEquals( 'key', $data['meta_data'][0]->key );
$this->assertEquals( 'value', $data['meta_data'][0]->value );
$this->assertEquals( 'key2', $data['meta_data'][1]->key );
$this->assertEquals( 'value2', $data['meta_data'][1]->value );
$this->stoppit_and_tidyup();
}

View File

@ -27,17 +27,18 @@ class WC_Tests_Install extends WC_Unit_Test_Case {
* Test - install.
*/
public function test_install() {
// clean existing install first
// clean existing install first.
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
define( 'WP_UNINSTALL_PLUGIN', true );
define( 'WC_REMOVE_ALL_DATA', true );
}
include( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/uninstall.php' );
delete_transient( 'wc_installing' );
WC_Install::install();
$this->assertTrue( get_option( 'woocommerce_version' ) === WC()->version );
$this->assertEquals( WC()->version, get_option( 'woocommerce_version' ), print_r( array( 'Stored version' => get_option( 'woocommerce_version' ), 'WC Version' => WC()->version ), true ) );
}
/**