39 lines
692 B
PHP
39 lines
692 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 MM();
|
|
$this->array_like = new MM(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));
|
|
}
|
|
|
|
} |