Example #1
0
 public function testArrayDotExpand()
 {
     $data = array('test.data' => 'The data', 'test.number' => 42, 'test.o.t.t' => true);
     $unflattenedData = array_dot_expand($data);
     $this->assertEquals('The data', $unflattenedData['test']['data']);
     $this->assertTrue($unflattenedData['test']['o']['t']['t']);
 }
Example #2
0
 public function testArrayDotExpand3()
 {
     $array = ['hello' => 'string', 'hello.world' => ['hey' => 'hello']];
     $final = ['hello' => ['world' => ['hey' => 'hello']]];
     $this->assertEquals(array_dot_expand($array), $final);
 }