start writing code
This commit is contained in:
parent
e529cd2328
commit
cca552c32c
@ -1,7 +1,10 @@
|
||||
<?php
|
||||
|
||||
class DailyImageWidget {
|
||||
|
||||
function render() {
|
||||
if (!empty($this->data)) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
7
daily-image-widget.php
Normal file
7
daily-image-widget.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
require_once("classes/DailyImageWidget.php");
|
||||
|
||||
$daily_image_widget = new DailyImageWidget();
|
||||
|
||||
?>
|
@ -1,9 +1,22 @@
|
||||
<?php
|
||||
|
||||
require_once('phpunit/Framework.php');
|
||||
require_once('PHPUnit/Framework.php');
|
||||
require_once(dirname(__FILE__) . '/../classes/DailyImageWidget.php');
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Loading…
Reference in New Issue
Block a user