示例#1
0
 /**
  * Test maxDimensions
  *
  * @return void
  */
 public function testMaxDimensions()
 {
     $data = array();
     $result = Hash::maxDimensions($data);
     $this->assertEquals(0, $result);
     $data = array('a', 'b');
     $result = Hash::maxDimensions($data);
     $this->assertEquals(1, $result);
     $data = array('1' => '1.1', '2', '3' => array('3.1' => '3.1.1'));
     $result = Hash::maxDimensions($data);
     $this->assertEquals($result, 2);
     $data = array('1' => array('1.1' => '1.1.1'), '2', '3' => array('3.1' => array('3.1.1' => '3.1.1.1')));
     $result = Hash::maxDimensions($data);
     $this->assertEquals($result, 3);
     $data = array('1' => array('1.1' => '1.1.1', '1.2' => array('1.2.1' => array('1.2.1.1', array('1.2.2.1')))), '2' => array('2.1' => '2.1.1'));
     $result = Hash::maxDimensions($data);
     $this->assertEquals($result, 5);
 }