Skip to content

Commit

Permalink
Added tests for the Arr::get() method
Browse files Browse the repository at this point in the history
  • Loading branch information
owenvoke committed Oct 17, 2017
1 parent 682881b commit b42e3b2
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tests/Arr/GetTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace Yetii\Tests\Arr;

use PHPUnit\Framework\TestCase;
use YeTii\General\Arr;

/**
* Class GetTest
*/
class GetTest extends TestCase
{
/**
* @var array
*/
public $testData = [
'bananas' => [
'oranges' => [
'apples' => 'pears'
]
]
];

/**
* Test whether it returns the value for the specified key
*/
public function testCanGetValueAtSpecifiedKey()
{
$array = new Arr($this->testData);
$this->assertArrayHasKey('apples', $array->get('bananas.oranges'));
$this->assertTrue($array->get('bananas.oranges.apples') === 'pears');
}
}

0 comments on commit b42e3b2

Please sign in to comment.