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
a5e71621
Commit
a5e71621
authored
Nov 27, 2012
by
Ivan Chepurnyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
! Fix config fixtures problem
parent
a2e81d5f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
app/code/community/EcomDev/PHPUnit/Model/Config.php
app/code/community/EcomDev/PHPUnit/Model/Config.php
+8
-0
app/code/community/EcomDev/PHPUnit/Model/Fixture.php
app/code/community/EcomDev/PHPUnit/Model/Fixture.php
+19
-0
No files found.
app/code/community/EcomDev/PHPUnit/Model/Config.php
View file @
a5e71621
...
...
@@ -48,6 +48,14 @@ class EcomDev_PHPUnit_Model_Config extends Mage_Core_Model_Config
*/
protected
$_replaceInstanceCreation
=
array
();
/**
* No cache sections should be cached,
* in favor to get rid of buggy config set options
*
* @var array
*/
protected
$_cacheSections
=
array
();
/**
* Load config data from DB
*
...
...
app/code/community/EcomDev/PHPUnit/Model/Fixture.php
View file @
a5e71621
...
...
@@ -488,6 +488,7 @@ class EcomDev_PHPUnit_Model_Fixture
*
* @param array $configuration
* @return EcomDev_PHPUnit_Model_Fixture
* @throws InvalidArgumentException in case if wrong configuration array supplied
*/
protected
function
_applyConfig
(
$configuration
)
{
...
...
@@ -522,6 +523,7 @@ class EcomDev_PHPUnit_Model_Fixture
*
* @param array $configuration
* @return EcomDev_PHPUnit_Model_Fixture
* @throws InvalidArgumentException in case of wrong configuration data passed
*/
protected
function
_applyConfigXml
(
$configuration
)
{
...
...
@@ -665,6 +667,23 @@ class EcomDev_PHPUnit_Model_Fixture
*/
protected
function
_setConfigNodeValue
(
$path
,
$value
)
{
$originalNode
=
Mage
::
getConfig
()
->
getNode
(
$path
);
// Support for custom backend values
if
(
!
empty
(
$value
)
&&
$originalNode
!==
false
&&
$originalNode
->
getAttribute
(
'backend_model'
))
{
$backend
=
Mage
::
getModel
((
string
)
$originalNode
->
getAttribute
(
'backend_model'
));
$dataPath
=
explode
(
'/'
,
$path
);
if
(
current
(
$dataPath
)
===
'default'
)
{
array_shift
(
$dataPath
);
}
elseif
(
current
(
$dataPath
)
===
'websites'
||
current
(
$dataPath
)
===
'stores'
)
{
$dataPath
=
array_splice
(
$dataPath
,
0
,
2
);
}
$backend
->
setPath
(
implode
(
'/'
,
$dataPath
))
->
setValue
(
$value
);
EcomDev_Utils_Reflection
::
invokeRestrictedMethod
(
$backend
,
'_beforeSave'
);
$value
=
$backend
->
getValue
();
}
Mage
::
getConfig
()
->
setNode
(
$path
,
$value
);
return
$this
;
}
...
...
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