default_generation_definitions = array( 'comment_author' => 'WooCommerce', 'comment_author_email' => 'woocommerce@noreply.com', 'comment_agent' => 'WooCommerce Hookshot', 'comment_type' => 'webhook_delivery', 'comment_parent' => 0, 'comment_approved' => 1, 'comment_content' => 'HTTP 200: OK', ); } /** * Create a mock webhook delivery. * * @since 2.2 * @see WP_UnitTest_Factory_For_comment::create_object() * @param array $args * @return int webhook delivery (comment) ID */ public function create_object( $args ) { $id = parent::create_object( $args ); $comment_meta_args = array( '_request_method' => 'POST', '_request_headers' => array( 'User-Agent', 'WooCommerce Hookshot' ), '_request_body' => "webhook_id={$id}", '_response_code' => 200, '_response_messaage' => 'OK', '_response_headers' => array( 'server' => 'nginx' ), '_response_body' => 'OK', '_duration' => '0.47976', ); foreach ( $comment_meta_args as $key => $value ) { update_comment_meta( $id, $key, $value ); } return $id; } }