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
5cd47c08
Commit
5cd47c08
authored
Aug 02, 2013
by
Jim O'Halloran
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/disable_modules' into feature/bundle_fixture_loader
parents
e43bf5d0
504c2848
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
6 deletions
+44
-6
app/code/community/EcomDev/PHPUnit/Model/Config.php
app/code/community/EcomDev/PHPUnit/Model/Config.php
+38
-3
app/code/community/EcomDev/PHPUnit/Model/Fixture.php
app/code/community/EcomDev/PHPUnit/Model/Fixture.php
+3
-0
app/code/community/EcomDev/PHPUnit/Model/Mysql4/Fixture/Eav/Catalog/Product.php
...mDev/PHPUnit/Model/Mysql4/Fixture/Eav/Catalog/Product.php
+3
-3
No files found.
app/code/community/EcomDev/PHPUnit/Model/Config.php
View file @
5cd47c08
...
...
@@ -56,6 +56,13 @@ class EcomDev_PHPUnit_Model_Config extends Mage_Core_Model_Config
*/
protected
$_cacheSections
=
array
();
/**
* Object containing parsed local.xml.phpunit
*
* @var null
*/
protected
$_localXmlForTest
=
null
;
/**
* Load config data from DB
*
...
...
@@ -215,6 +222,22 @@ class EcomDev_PHPUnit_Model_Config extends Mage_Core_Model_Config
return
$this
;
}
protected
function
_isAllowedModule
(
$moduleName
)
{
if
(
!
parent
::
_isAllowedModule
(
$moduleName
))
{
return
false
;
}
$localXml
=
$this
->
_loadLocalXmlForTest
();
if
(
$localXml
)
{
$node
=
$localXml
->
getNode
(
"phpunit/disable_modules/
$moduleName
"
);
return
$node
===
false
;
}
return
true
;
}
/**
* (non-PHPdoc)
* @see Mage_Core_Model_Config::loadModules()
...
...
@@ -235,10 +258,8 @@ class EcomDev_PHPUnit_Model_Config extends Mage_Core_Model_Config
*/
protected
function
_loadTestConfig
()
{
$merge
=
clone
$this
->
_prototype
;
try
{
if
(
$merge
->
loadFile
(
$this
->
_getLocalXmlForTest
()
))
{
if
(
$merge
=
$this
->
_loadLocalXmlForTest
(
))
{
$this
->
_checkDbCredentialForDuplicate
(
$this
,
$merge
);
$this
->
_checkBaseUrl
(
$this
,
$merge
);
$this
->
extend
(
$merge
);
...
...
@@ -253,6 +274,20 @@ class EcomDev_PHPUnit_Model_Config extends Mage_Core_Model_Config
return
$this
;
}
/**
* Parse the phpunit specific local configuration. THis may be loaded by
* and used by _isAllowedModule before it's merged into the merged config.
*
* @return Mage_Core_Model_Config_Base|null
*/
protected
function
_loadLocalXmlForTest
()
{
if
(
$this
->
_localXmlForTest
===
null
)
{
$this
->
_localXmlForTest
=
clone
$this
->
_prototype
;
$this
->
_localXmlForTest
->
loadFile
(
$this
->
_getLocalXmlForTest
());
}
return
$this
->
_localXmlForTest
;
}
/**
* Loads cache configuration for PHPUnit tests scope
*
...
...
app/code/community/EcomDev/PHPUnit/Model/Fixture.php
View file @
5cd47c08
...
...
@@ -739,6 +739,9 @@ class EcomDev_PHPUnit_Model_Fixture
if
(
is_dir
(
Mage
::
getBaseDir
(
'lib'
)
.
DS
.
'vfsStream'
.
DS
.
'src'
))
{
spl_autoload_register
(
array
(
$this
,
'vfsAutoload'
),
true
,
true
);
}
if
(
class_exists
(
'\org\bovigo\vfs\vfsStream'
)
){
$this
->
_vfs
=
Mage
::
getModel
(
'ecomdev_phpunit/fixture_vfs'
);
return
$this
->
_vfs
;
}
...
...
app/code/community/EcomDev/PHPUnit/Model/Mysql4/Fixture/Eav/Catalog/Product.php
View file @
5cd47c08
...
...
@@ -133,11 +133,11 @@ class EcomDev_PHPUnit_Model_Mysql4_Fixture_Eav_Catalog_Product extends EcomDev_P
$records
=
array
();
$attributeCodes
=
$entityTypeModel
->
getAttributeCollection
();
foreach
(
$row
[
'super_attributes'
]
as
$attributeCode
)
{
$
oA
ttribute
=
$attributeCodes
->
getItemByColumnValue
(
'attribute_code'
,
$attributeCode
);
if
(
!
$
oA
ttribute
){
$
a
ttribute
=
$attributeCodes
->
getItemByColumnValue
(
'attribute_code'
,
$attributeCode
);
if
(
!
$
a
ttribute
){
throw
new
Exception
(
'Super attribute not found with code: '
.
$attributeCode
);
}
$attributeId
=
$
oA
ttribute
->
getId
();
$attributeId
=
$
a
ttribute
->
getId
();
$records
[]
=
array
(
'product_id'
=>
$row
[
$this
->
_getEntityIdField
(
$entityTypeModel
)],
'attribute_id'
=>
$attributeId
...
...
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