cleaned up arr tests.
This commit is contained in:
parent
b3c9dc59c0
commit
bb77189f35
|
@ -5,7 +5,7 @@ class ArrTest extends PHPUnit_Framework_TestCase {
|
|||
/**
|
||||
* @dataProvider getArray
|
||||
*/
|
||||
public function testGetMethodReturnsItemsFromArray($array)
|
||||
public function test_get_method_returns_item_from_array($array)
|
||||
{
|
||||
$this->assertEquals(Arr::get($array, 'email'), $array['email']);
|
||||
$this->assertEquals(Arr::get($array, 'names.uncle'), $array['names']['uncle']);
|
||||
|
@ -14,7 +14,7 @@ public function testGetMethodReturnsItemsFromArray($array)
|
|||
/**
|
||||
* @dataProvider getArray
|
||||
*/
|
||||
public function testGetMethodReturnsDefaultWhenItemDoesntExist($array)
|
||||
public function test_get_method_returns_default_when_item_doesnt_exist($array)
|
||||
{
|
||||
$this->assertNull(Arr::get($array, 'names.aunt'));
|
||||
$this->assertEquals(Arr::get($array, 'names.aunt', 'Tammy'), 'Tammy');
|
||||
|
@ -24,7 +24,7 @@ public function testGetMethodReturnsDefaultWhenItemDoesntExist($array)
|
|||
/**
|
||||
* @dataProvider getArray
|
||||
*/
|
||||
public function testSetMethodSetsItemsInArray($array)
|
||||
public function test_set_method_sets_items_in_array($array)
|
||||
{
|
||||
Arr::set($array, 'name', 'Taylor');
|
||||
Arr::set($array, 'names.aunt', 'Tammy');
|
||||
|
@ -37,7 +37,7 @@ public function testSetMethodSetsItemsInArray($array)
|
|||
/**
|
||||
* @dataProvider getArray
|
||||
*/
|
||||
public function testFirstMethodReturnsFirstItemPassingTruthTest($array)
|
||||
public function test_first_method_returns_first_item_passing_truth_test($array)
|
||||
{
|
||||
$array['email2'] = 'taylor@hotmail.com';
|
||||
$this->assertEquals('taylorotwell@gmail.com', Arr::first($array, function($k, $v) {return substr($v, 0, 3) == 'tay';}));
|
||||
|
@ -46,7 +46,7 @@ public function testFirstMethodReturnsFirstItemPassingTruthTest($array)
|
|||
/**
|
||||
* @dataProvider getArray
|
||||
*/
|
||||
public function testFirstMethodReturnsDefaultWhenNoItemExists($array)
|
||||
public function test_first_method_returns_default_when_no_matching_item_is_found($array)
|
||||
{
|
||||
$this->assertNull(Arr::first($array, function($k, $v) {return $v === 'something';}));
|
||||
$this->assertEquals('default', Arr::first($array, function($k, $v) {return $v === 'something';}, 'default'));
|
||||
|
|
Loading…
Reference in New Issue