Esempio n. 1
0
 /**
  * @dataProvider getDefaultDesignTabsDataProvider
  */
 public function testGetDefaultDesignTabs($appType)
 {
     $application = new Mage_XmlConnect_Model_Application();
     $application->setType($appType);
     $tabs = $this->_helper->getDeviceHelper($application)->getDefaultDesignTabs();
     $this->assertNotEmpty($tabs);
     foreach ($tabs as $tab) {
         $this->assertArrayHasKey('image', $tab);
     }
 }
 /**
  * Check device cookies
  *
  * @return null
  */
 public function _checkCookie()
 {
     $AdminDeviceCookie = self::DEVICE_TYPE_COOKIE_NAME;
     $currentDevice = isset($_COOKIE[$AdminDeviceCookie]) ? (string) $_COOKIE[$AdminDeviceCookie] : '';
     if (!array_key_exists($currentDevice, Mage_XmlConnect_Helper_Data::getSupportedDevices())) {
         $this->_message(Mage_XmlConnect_Model_Simplexml_Message_Error::ERROR_CLIENT_SP_CONFIG_RELOAD_REQUIRED, $this->__('Device type doesn\'t recognized.'));
         $this->setFlag('', self::FLAG_NO_DISPATCH, true);
         return;
     }
     $screenSizeCookieName = Mage_XmlConnect_Model_Application::APP_SCREEN_SIZE_NAME;
     $screenSize = isset($_COOKIE[$screenSizeCookieName]) ? (string) $_COOKIE[$screenSizeCookieName] : '';
     if (!$screenSize) {
         $deviceClassName = 'Mage_XmlConnect_Model_Device_' . ucfirst($currentDevice);
         $_COOKIE[$screenSizeCookieName] = constant($deviceClassName . '::SCREEN_SIZE_DEFAULT');
     }
 }