start writing code

This commit is contained in:
John Bintz 2009-06-03 17:29:23 -04:00
parent e529cd2328
commit cca552c32c
3 changed files with 26 additions and 3 deletions

View File

@ -1,7 +1,10 @@
<?php <?php
class DailyImageWidget { class DailyImageWidget {
function render() {
if (!empty($this->data)) {
}
}
} }
?> ?>

7
daily-image-widget.php Normal file
View File

@ -0,0 +1,7 @@
<?php
require_once("classes/DailyImageWidget.php");
$daily_image_widget = new DailyImageWidget();
?>

View File

@ -1,9 +1,22 @@
<?php <?php
require_once('phpunit/Framework.php'); require_once('PHPUnit/Framework.php');
require_once(dirname(__FILE__) . '/../classes/DailyImageWidget.php');
class DailyImageWidgetTest extends PHPUnit_Framework_TestCase { class DailyImageWidgetTest extends PHPUnit_Framework_TestCase {
function setUp() {
$this->diw = new DailyImageWidget();
}
function testRetrieveDataFailure() {
$this->diw->data = false;
ob_start();
$this->diw->render();
$result = ob_get_clean();
$this->assertTrue(empty($result));
}
} }
?> ?>