toArray() 공개 메소드

Returns the content of the NavigationItem as array.
public toArray ( ) : array
리턴 array
예제 #1
0
 public function testToArray()
 {
     $array = $this->item1->toArray();
     $this->assertEquals('Root', $array['title']);
     $this->assertEquals('action', $array['action']);
     $this->assertEquals('logo', $array['header']['logo']);
     $this->assertEquals('title', $array['header']['title']);
     $this->assertEquals('Portals', $array['items'][0]['title']);
     $this->assertEquals(null, $array['items'][0]['action']);
     $this->assertEquals('Settings', $array['items'][1]['title']);
     $this->assertEquals(null, $array['items'][1]['action']);
     $array = $this->item2->toArray();
     $this->assertNotContains('header', array_keys($array));
 }