Esempio n. 1
0
 /**
  * @param CM_Frontend_Environment $environment
  */
 public function setValueByEnvironment(CM_Frontend_Environment $environment)
 {
     $location = $environment->getLocation();
     $location = $this->_squashLocationInConstraints($location);
     if (null !== $location) {
         $this->setValue($location);
     }
 }
Esempio n. 2
0
 public function testSetNull()
 {
     $environment = new CM_Frontend_Environment();
     $this->assertEquals(CM_Site_Abstract::factory(), $environment->getSite());
     $this->assertNull($environment->getViewer());
     $this->assertNull($environment->getLanguage());
     $this->assertSame('en', $environment->getLocale());
     $this->assertEquals(CM_Bootloader::getInstance()->getTimeZone(), $environment->getTimeZone());
     $this->assertSame(CM_Bootloader::getInstance()->isDebug(), $environment->isDebug());
     $this->assertNull($environment->getLocation());
 }
Esempio n. 3
0
 public function testSetNull()
 {
     $defaultCurrency = CM_Model_Currency::create('840', 'USD');
     $environment = new CM_Frontend_Environment();
     $this->assertEquals(CM_Site_Abstract::factory(), $environment->getSite());
     $this->assertNull($environment->getViewer());
     $this->assertNull($environment->getLanguage());
     $this->assertSame('en', $environment->getLocale());
     $this->assertEquals(CM_Bootloader::getInstance()->getTimeZone(), $environment->getTimeZone());
     $this->assertSame(CM_Bootloader::getInstance()->isDebug(), $environment->isDebug());
     $this->assertNull($environment->getLocation());
     $this->assertEquals($defaultCurrency, $environment->getCurrency());
     $this->assertNull($environment->getClientDevice());
 }