miniMVC/tests/commonTest.php

39 lines
751 B
PHP
Raw Normal View History

<?php
/**
* Test class for /src/sys/common.php
*/
class commonTest extends UnitTestCase {
2012-07-12 10:23:55 -04:00
public function __construct()
{
parent::__construct('Common.php Tests');
}
2012-07-12 10:23:55 -04:00
public function setUp()
{
$this->empty = array();
$this->object = new stdClass();
$this->array_like = new stdClass(array('foo' => 'bar'));
}
2012-07-12 10:23:55 -04:00
public function tearDown()
{
unset($this->empty);
unset($this->object);
unset($this->array_like);
}
2012-07-12 10:23:55 -04:00
public function testEmptyArrayNotLikeArray()
{
// Empty is not array like
2012-05-22 11:11:36 -04:00
$this->assertFalse(miniMVC\is_like_array($this->empty));
}
2012-07-12 10:23:55 -04:00
public function testEmptyObjectIsLikeArray()
{
// Empty object is array like - because objects are truthy
2012-05-22 11:11:36 -04:00
$this->assertTrue(miniMVC\is_like_array($this->object));
}
}