Better whitespace

This commit is contained in:
claudiulodro 2018-01-04 10:31:28 -08:00
parent 431c9b5766
commit 1e0dbbf544
1 changed files with 10 additions and 4 deletions

View File

@ -901,15 +901,17 @@ class WC_Tests_CRUD_Orders extends WC_Unit_Test_Case {
* @since 3.3.0
*/
public function test_payment_complete_error() {
add_action( 'woocommerce_payment_complete', array( $this, 'throwAnException' ) );
$object = new WC_Order();
$object->save();
add_action( 'woocommerce_payment_complete', array( $this, 'throwAnException' ) );
$this->assertFalse( $object->payment_complete( '12345' ) );
$note = current( wc_get_order_notes( array(
'order_id' => $object->get_id(),
) ) );
$this->assertContains( 'Payment complete event failed', $note->content );
remove_action( 'woocommerce_payment_complete', array( $this, 'throwAnException' ) );
}
@ -952,13 +954,15 @@ class WC_Tests_CRUD_Orders extends WC_Unit_Test_Case {
public function test_update_status_error() {
$object = new WC_Order();
$object->save();
add_filter( 'woocommerce_payment_complete_order_status', array( $this, 'throwAnException' ) );
$this->assertFalse( $object->update_status( 'on-hold' ) );
$note = current( wc_get_order_notes( array(
'order_id' => $object->get_id(),
) ) );
$this->assertContains( 'Update status event failed', $note->content );
remove_filter( 'woocommerce_payment_complete_order_status', array( $this, 'throwAnException' ) );
}
@ -1881,13 +1885,15 @@ class WC_Tests_CRUD_Orders extends WC_Unit_Test_Case {
public function test_save_exception() {
$object = new WC_Order();
$object->save();
add_action( 'woocommerce_before_order_object_save', array( $this, 'throwAnException' ) );
$object->save();
$note = current( wc_get_order_notes( array(
'order_id' => $object->get_id(),
) ) );
$this->assertContains( 'Error saving order', $note->content );
remove_action( 'woocommerce_before_order_object_save', array( $this, 'throwAnException' ) );
}
}