Adding __unset magic method

This commit is contained in:
Reza
2015-11-09 19:57:05 +03:30
parent 5c6488293f
commit 001bd6add5
2 changed files with 32 additions and 11 deletions

View File

@ -127,6 +127,17 @@ class Test extends PHPUnit_Framework_TestCase
$this->assertEquals(json_encode(new Ary($original)), json_encode((array)$original));
}
/**
* @dataProvider various
*/
public function ary()
{
$test = ['x' => ['xx' => 'xxx']];
$ary = new Ary($test);
$this->assertEquals(ary($test)->x['xx'], $ary->ary('x')->xx);
$this->assertEquals(ary(ary($test)->x['xx']), $ary->ary('x')->ary('xx'));
}
// public function testOffsetExists()
// {
// $parameters = array(7,8,9,4);