Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
EcomDev_PHPUnit
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Open
EcomDev_PHPUnit
Commits
e235af33
Commit
e235af33
authored
Sep 29, 2013
by
Ivan Chepurnyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start of fixture refactoring process
parent
271a7c30
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
272 deletions
+4
-272
app/code/community/EcomDev/PHPUnit/Model/Config.php
app/code/community/EcomDev/PHPUnit/Model/Config.php
+2
-1
app/code/community/EcomDev/PHPUnit/Model/Fixture.php
app/code/community/EcomDev/PHPUnit/Model/Fixture.php
+1
-270
app/code/community/EcomDev/PHPUnit/Model/Fixture/Processor/Eav.php
...community/EcomDev/PHPUnit/Model/Fixture/Processor/Eav.php
+1
-1
No files found.
app/code/community/EcomDev/PHPUnit/Model/Config.php
View file @
e235af33
...
...
@@ -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
()
...
...
app/code/community/EcomDev/PHPUnit/Model/Fixture.php
View file @
e235af33
...
...
@@ -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
;
}
}
app/code/community/EcomDev/PHPUnit/Model/Fixture/Processor/Eav.php
View file @
e235af33
...
...
@@ -97,7 +97,7 @@ class EcomDev_PHPUnit_Model_Fixture_Processor_Eav
$this
->
getResource
()
->
commit
();
foreach
(
$eavLoaders
as
$eavLoader
){
foreach
(
$eavLoaders
as
$eavLoader
)
{
$eavLoader
->
runRequiredIndexers
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment