Example #1
0
 /**
  * Tests that proxy saves data between instantiations
  */
 public function testSaving()
 {
     $module = 'Some_Module';
     $file = 'internal/path/to/skin_file.ext';
     $expectedPublicFile = 'public/path/to/skin_file.ext';
     $params = array('area' => 'frontend', 'package' => 'package', 'theme' => 'theme', 'skin' => 'skin', 'locale' => 'en_US', 'canSaveMap' => true, 'mapDir' => self::$_tmpDir, 'baseDir' => '');
     $model = new Mage_Core_Model_Design_Fallback_CachingProxy($params);
     $model->notifySkinFilePublished($expectedPublicFile, $file, $module);
     $globPath = self::$_tmpDir . DIRECTORY_SEPARATOR . '*.*';
     $this->assertEmpty(glob($globPath));
     unset($model);
     $this->assertNotEmpty(glob($globPath));
     /** @var $model Mage_Core_Model_Design_Fallback_CachingProxy */
     $model = $this->getMock('Mage_Core_Model_Design_Fallback_CachingProxy', array('_getFallback'), array($params));
     $model->expects($this->never())->method('_getFallback');
     $actualPublicFile = $model->getSkinFile($file, $module);
     $this->assertEquals($expectedPublicFile, $actualPublicFile);
 }