better tests

This commit is contained in:
Anton Grebnev
2011-10-10 14:21:44 +04:00
parent 3c3071fb15
commit 7d12bcf26c
3 changed files with 53 additions and 1 deletions

View File

@ -32,17 +32,26 @@ class ConfigTest extends PHPUnit_Framework_TestCase
$this->assertNotEquals('Config', get_class(Config::getInstance()));
}
/**
* @expectedException Exception
*/
public function testArrayAsParam()
{
$arr = array(
'one' => 1,
'two' => 2,
'three' => 3
'three' => 3,
4 => 'four'
);
Config::set(0, $arr);
$new_arr = Config::get(0);
$this->assertEquals('ConfigArray', get_class($new_arr));
$this->assertEquals('four', $new_arr->offsetGet(4));
$this->assertEquals(1, $new_arr->offsetGet('one'));
$this->assertNotEquals(1, $new_arr->offsetGet('two'));
$new_arr->offsetGet(24);
}
}