miniMVC/tests/commonTest.php

39 lines
704 B
PHP

<?php
/**
* Test class for /src/sys/common.php
*/
class commonTest extends UnitTestCase {
function __construct()
{
parent::__construct('Common.php Tests');
}
function setUp()
{
$this->empty = array();
$this->object = new JSObject();
$this->array_like = new JSObject(array('foo' => 'bar'));
}
function tearDown()
{
unset($this->empty);
unset($this->object);
unset($this->array_like);
}
function testEmptyArrayNotLikeArray()
{
// Empty is not array like
$this->assertFalse(is_like_array($this->empty));
}
function testEmptyObjectIsLikeArray()
{
// Empty object is array like - because objects are truthy
$this->assertTrue(is_like_array($this->object));
}
}