added arr tests.
This commit is contained in:
parent
23f167acc7
commit
ca3c6623a2
|
@ -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');
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue