comicpress-2.8/test/widgets/BuyThisPrintWidgetTest.php

37 lines
798 B
PHP
Raw Normal View History

2009-11-21 16:00:41 +00:00
<?php
require_once('PHPUnit/Framework.php');
require_once('MockPress/mockpress.php');
2009-12-25 18:38:56 +00:00
require_once(dirname(__FILE__) . '/../../widgets/BuyPrintWidget.inc');
2009-11-21 16:00:41 +00:00
class BuyThisPrintWidgetTest extends PHPUnit_Framework_TestCase {
function setUp() {
_reset_wp();
2009-12-25 18:38:56 +00:00
$this->w = new ComicPressBuyPrintWidget('id', 'name', array());
2009-11-21 16:00:41 +00:00
}
function providerTestUpdate() {
return array(
array(
array(), array()
),
array(
array('test' => 'test'), array()
),
array(
array('title' => 'title'), array('title' => 'title')
),
array(
array('title' => "<i>title</i>"), array('title' => 'title')
)
);
}
/**
* @dataProvider providerTestUpdate
*/
function testUpdate($input, $expected_output) {
$this->assertEquals($expected_output, $this->w->update($input));
}
}