woocommerce/tests/legacy/unit-tests/widgets/class-dummy-widget.php

30 lines
691 B
PHP
Raw Normal View History

2017-12-14 11:57:53 +00:00
<?php
/**
* Dummy widget class extending WC_Widget.
*/
class Dummy_Widget extends WC_Widget {
/**
* Constructor.
*/
public function __construct() {
$this->widget_cssclass = 'widget_dummy';
$this->widget_description = __( 'A dummy widget', 'woocommerce' );
$this->widget_id = 'wc_dummy_widget';
$this->widget_name = __( 'Dummy Widget', 'woocommerce' );
parent::__construct();
}
/**
* Output widget.
*
* @param mixed $args Arguments.
2017-12-14 11:57:53 +00:00
* @param WP_Widget $instance Intance of WP_Widget.
* @return void
*/
public function widget( $args, $instance ) {
ob_start();
echo 'Dummy';
echo $this->cache_widget( $args, ob_get_clean() );
}
}