We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

Commit e235af33 authored by Ivan Chepurnyi's avatar Ivan Chepurnyi

Start of fixture refactoring process

parent 271a7c30
......@@ -30,7 +30,7 @@ class EcomDev_PHPUnit_Model_Config extends Mage_Core_Model_Config
/**
* Scope snapshot with different levels of saving configuration
*
* @var Mage_Core_Model_Config_Base
* @var Mage_Core_Model_Config_Base[]
*/
protected $_scopeSnapshot = array();
......@@ -170,6 +170,7 @@ class EcomDev_PHPUnit_Model_Config extends Mage_Core_Model_Config
/**
* Loads scope snapshot
*
* @throws RuntimeException
* @return EcomDev_PHPUnit_Model_Config
*/
public function loadScopeSnapshot()
......
......@@ -324,17 +324,6 @@ class EcomDev_PHPUnit_Model_Fixture
return $this;
}
/**
* Loads test case cache on off annotations
*
* @param array $annotations
* @return EcomDev_PHPUnit_Model_Fixture
* @deprecated since 0.3.0
*/
protected function _parseCacheOptions($annotations)
{
return $this;
}
/**
* Sets fixture value
......@@ -490,241 +479,6 @@ class EcomDev_PHPUnit_Model_Fixture
$this->_fixture = array();
}
/**
* Applies cache options for current test or test case
*
* @param array $options
* @return EcomDev_PHPUnit_Model_Fixture
* @deprecated since 0.3.0
*/
protected function _applyCacheOptions($options)
{
return $this;
}
/**
* Discards changes that were made to Magento cache
*
* @return EcomDev_PHPUnit_Model_Fixture
* @deprecated since 0.3.0
*/
protected function _discardCacheOptions()
{
return $this;
}
/**
* Applies fixture configuration values into Mage_Core_Model_Config
*
* @param array $configuration
* @return EcomDev_PHPUnit_Model_Fixture
* @deprecated since 0.3.0
* @throws InvalidArgumentException in case if wrong configuration array supplied
*/
protected function _applyConfig($configuration)
{
return $this;
}
/**
* Applies raw xml data to config node
*
* @param array $configuration
* @return EcomDev_PHPUnit_Model_Fixture
* @deprecated since 0.3.0
* @throws InvalidArgumentException in case of wrong configuration data passed
*/
protected function _applyConfigXml($configuration)
{
return $this;
}
/**
* Restores config to a previous configuration scope
*
* @return EcomDev_PHPUnit_Model_Fixture
* @deprecated since 0.3.0
*/
protected function _restoreConfig()
{
return $this;
}
/**
* Reverts fixture configuration values in Mage_Core_Model_Config
*
* @return EcomDev_PHPUnit_Model_Fixture
* @deprecated since 0.3.0
*/
protected function _discardConfig()
{
return $this;
}
/**
* Reverts fixture configuration xml values in Mage_Core_Model_Config
*
* @return EcomDev_PHPUnit_Model_Fixture
* @deprecated since 0.3.0
*/
protected function _discardConfigXml()
{
return $this;
}
/**
* Applies table data into test database
*
* @param array $tables
* @return EcomDev_PHPUnit_Model_Fixture
* @deprecated since 0.3.0
*/
protected function _applyTables($tables)
{
return $this;
}
/**
* Removes table data from test data base
*
* @param array $tables
* @return EcomDev_PHPUnit_Model_Fixture
* @deprecated since 0.3.0
*/
protected function _discardTables($tables)
{
return $this;
}
/**
* Setting config value with applying the values to stores and websites
*
* @param string $path
* @param string $value
* @return EcomDev_PHPUnit_Model_Fixture
* @deprecated since 0.3.0
*/
protected function _setConfigNodeValue($path, $value)
{
return $this;
}
/**
* Retrieves eav loader for a particular entity type
*
* @param string $entityType
* @return EcomDev_PHPUnit_Model_Mysql4_Fixture_Eav_Abstract
* @deprecated since 0.3.0
*/
protected function _getEavLoader($entityType)
{
return $this->_getComplexLoader($entityType, 'EAV');
}
/**
* Retrieves the loader for a particular entity type and data type
*
* @throws InvalidArgumentException
* @param string $entityType
* @param string $dataType
* @return EcomDev_PHPUnit_Model_Mysql4_Fixture
* @deprecated since 0.3.0
*/
protected function _getComplexLoader($entityType, $dataType)
{
if(!$dataType) {
throw new InvalidArgumentException('Must specify a data type for the loader');
}
$reflection = EcomDev_Utils_Reflection::getRelflection($this);
$loaders = Mage::getConfig()->getNode($reflection->getConstant("XML_PATH_FIXTURE_{$dataType}_LOADERS"));
if (isset($loaders->$entityType)) {
$classAlias = (string)$loaders->$entityType;
} elseif (isset($loaders->{self::DEFAULT_EAV_LOADER_NODE})) {
$classAlias = (string)$loaders->{self::DEFAULT_EAV_LOADER_NODE};
} else {
$classAlias = self::DEFAULT_EAV_LOADER_CLASS;
}
return Mage::getResourceSingleton($classAlias);
}
/**
* Applies fixture EAV values
*
* @param array $entities
* @return EcomDev_PHPUnit_Model_Fixture
* @deprecated since 0.3.0
*/
protected function _applyEav($entities)
{
return $this;
}
/**
* Clean applied eav data
*
* @param array $entities
* @return EcomDev_PHPUnit_Model_Fixture
* @deprecated since 0.3.0
*/
protected function _discardEav($entities)
{
return $this;
}
/**
* Applies scope fixture,
* i.e., website, store, store group
*
* @param array $types
* @return EcomDev_PHPUnit_Model_Fixture
* @deprecated since 0.3.0
*/
protected function _applyScope($types)
{
return $this;
}
/**
* Handle scope row data
*
* @param string $type
* @param array $row
* @return boolean|Mage_Core_Model_Abstract
* @deprecated since 0.3.0
*/
protected function _handleScopeRow($type, $row)
{
return false;
}
/**
* Validate scope data
*
* @param array $types
* @return EcomDev_PHPUnit_Model_Fixture
* @deprecated since 0.3.0
*/
protected function _validateScope($types)
{
return $this;
}
/**
* Removes scope fixture changes,
* i.e., website, store, store group
*
* @return EcomDev_PHPUnit_Model_Fixture
* @deprecated since 0.3.0
*/
protected function _discardScope()
{
return $this;
}
/**
* Returns VFS wrapper instance
*
......@@ -741,7 +495,7 @@ class EcomDev_PHPUnit_Model_Fixture
spl_autoload_register(array($this, 'vfsAutoload'), true, true);
}
if( class_exists('\org\bovigo\vfs\vfsStream') ){
if (class_exists('\org\bovigo\vfs\vfsStream')) {
$this->_vfs = Mage::getModel('ecomdev_phpunit/fixture_vfs');
return $this->_vfs;
}
......@@ -769,27 +523,4 @@ class EcomDev_PHPUnit_Model_Fixture
return include $fileName;
}
/**
* Applies VFS structure fixture
*
* @param array $data
* @return EcomDev_PHPUnit_Model_Fixture
* @deprecated since 0.3.0
*/
protected function _applyVfs($data)
{
return $this;
}
/**
* Discards VFS structure fixture
*
* @return EcomDev_PHPUnit_Model_Fixture
* @deprecated since 0.3.0
*/
protected function _discardVfs()
{
return $this;
}
}
......@@ -97,7 +97,7 @@ class EcomDev_PHPUnit_Model_Fixture_Processor_Eav
$this->getResource()->commit();
foreach ($eavLoaders as $eavLoader){
foreach ($eavLoaders as $eavLoader) {
$eavLoader->runRequiredIndexers();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment