2012-01-17 11:55:42 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test class for /src/sys/common.php
|
|
|
|
*/
|
|
|
|
class commonTest extends UnitTestCase {
|
|
|
|
|
|
|
|
function __construct()
|
|
|
|
{
|
|
|
|
parent::__construct('Common.php Tests');
|
|
|
|
}
|
|
|
|
|
|
|
|
function setUp()
|
|
|
|
{
|
|
|
|
$this->empty = array();
|
2012-04-27 16:28:25 -04:00
|
|
|
$this->object = new MM();
|
|
|
|
$this->array_like = new MM(array('foo' => 'bar'));
|
2012-01-17 11:55:42 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
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));
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|