comicpress-2.8/test/widgets/CalendarWidgetTest.php

52 lines
1.1 KiB
PHP
Raw Normal View History

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