added arr tests.

This commit is contained in:
Taylor Otwell 2011-07-13 23:43:32 -05:00
parent 23f167acc7
commit ca3c6623a2
1 changed files with 17 additions and 0 deletions

17
tests/suite/ArrTest.php Normal file
View File

@ -0,0 +1,17 @@
<?php
class ArrTest extends PHPUnit_Framework_TestCase {
public function testReturnsDefaultWhenItemNotPresentInArray()
{
$this->assertNull(System\Arr::get(array(), 'name'));
$this->assertEquals(System\Arr::get(array(), 'name', 'test'), 'test');
$this->assertEquals(System\Arr::get(array(), 'name', function() {return 'test';}), 'test');
}
public function testReturnsItemWhenPresentInArray()
{
$this->assertEquals(System\Arr::get(array('name' => 'test'), 'name'), 'test');
}
}