/**
  * Retorna os dados gerados pela página (resultado de todo o processamento da página)
  * 
  * @return array
  */
 public function getPagedata()
 {
     if ($this->responseType == ResponseType::HTML && $this->htmlFull) {
         $this->pagedata = array_merge($this->pagedata, array('html' => array('pagetitle' => MemoryPage::getTitle(trim(PAGE_TITLE_PREFIX . ' ' . $this->pageTitle)), 'urlbase' => DOMAIN, 'css' => MemoryPage::getCss(), 'js' => MemoryPage::getJs(), 'extraheader' => MemoryPage::getExtraHeader()), '_page' => get_class($this), '_pagename' => strtolower(getClassNameFromNamespace(get_class($this))), '_action' => $this->method));
     }
     $this->pagedata = array_merge($this->pagedata, MemoryPage::getAttributes());
     $s = Session::getInstance();
     if ($s->isLogged()) {
         $this->pagedata['isLogged'] = true;
         $this->pagedata['isAdmin'] = $s->isAdmin();
         foreach ($s->getGroups() as $group) {
             $this->pagedata['is' . ucfirst($group)] = true;
         }
         $this->pagedata['session'] = array('id' => $s->getUserId(), 'nome' => $s->getUserName(), 'email' => $s->getData('email'));
     }
     $this->pagedata[SERVER_MODE] = true;
     $this->pagedata['error'] = LoggerApp::getErrors();
     //$this->pagedata["___get___"] =  $_GET;
     return $this->pagedata;
 }
 public function testMemoryPage()
 {
     //Title
     MemoryPage::setTitle("Teste de titulo");
     $this->assertEquals("Teste de titulo", MemoryPage::getTitle());
     Memory::clearAll();
     $this->assertEquals("", MemoryPage::getTitle(''));
     $this->assertEquals("default titulo", MemoryPage::getTitle('default titulo'));
     //Extra header
     $this->assertNotNull(MemoryPage::getExtraHeader());
     $this->assertEmpty(MemoryPage::getExtraHeader());
     MemoryPage::setExtraHeader('my content');
     $this->assertEquals('my content', MemoryPage::getExtraHeader());
     //CSS
     $this->assertEquals(array(), MemoryPage::getCss());
     MemoryPage::addCss('teste.css');
     $this->assertEquals(array('teste.css'), MemoryPage::getCss());
     MemoryPage::addCss('teste.css');
     $this->assertEquals(array('teste.css'), MemoryPage::getCss());
     MemoryPage::addCss('teste2.css');
     $this->assertEquals(array('teste.css', 'teste2.css'), MemoryPage::getCss());
     //JS
     $this->assertEquals(array(), MemoryPage::getJs());
     MemoryPage::addJs('teste.js');
     $this->assertEquals(array('teste.js'), MemoryPage::getJs());
     MemoryPage::addJs('teste.js');
     $this->assertEquals(array('teste.js'), MemoryPage::getJs());
     MemoryPage::addJs('teste2.js');
     $this->assertEquals(array('teste.js', 'teste2.js'), MemoryPage::getJs());
 }