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
e43bf5d0
Commit
e43bf5d0
authored
Jul 29, 2013
by
Jonathan Day
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correct variable naming per @IvanChepurnyi and adding some attribution
parent
2772edc0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
app/code/community/EcomDev/PHPUnit/Model/Fixture/Processor/Attributes.php
...ty/EcomDev/PHPUnit/Model/Fixture/Processor/Attributes.php
+6
-4
app/code/community/EcomDev/PHPUnit/Model/Mysql4/Fixture/Attribute/Abstract.php
...omDev/PHPUnit/Model/Mysql4/Fixture/Attribute/Abstract.php
+5
-4
No files found.
app/code/community/EcomDev/PHPUnit/Model/Fixture/Processor/Attributes.php
View file @
e43bf5d0
...
...
@@ -14,6 +14,8 @@
* @copyright Copyright (c) 2013 EcomDev BV (http://www.ecomdev.org)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* @author Ivan Chepurnyi <ivan.chepurnyi@ecomdev.org>
* @author Steve Rice <srice@endertech.com>
* @author Jonathan Day <jonathan@aligent.com.au>
*/
...
...
@@ -84,12 +86,12 @@ class EcomDev_PHPUnit_Model_Fixture_Processor_Attributes
*/
public
function
apply
(
array
$data
,
$key
,
EcomDev_PHPUnit_Model_Fixture_Interface
$fixture
)
{
$a
A
ttributeLoaders
=
array
();
$attributeLoaders
=
array
();
$this
->
getResource
()
->
beginTransaction
();
foreach
(
$data
as
$entityType
=>
$values
)
{
$a
A
ttributeLoaders
[]
=
$this
->
_getAttributeLoader
(
$entityType
)
$attributeLoaders
[]
=
$this
->
_getAttributeLoader
(
$entityType
)
->
setFixture
(
$fixture
)
->
setOptions
(
$fixture
->
getOptions
())
->
loadAttribute
(
$entityType
,
$values
);
...
...
@@ -97,8 +99,8 @@ class EcomDev_PHPUnit_Model_Fixture_Processor_Attributes
$this
->
getResource
()
->
commit
();
foreach
(
$a
AttributeLoaders
as
$oA
ttributeLoader
){
$
oA
ttributeLoader
->
runRequiredIndexers
();
foreach
(
$a
ttributeLoaders
as
$a
ttributeLoader
){
$
a
ttributeLoader
->
runRequiredIndexers
();
}
$fixture
->
setStorageData
(
self
::
STORAGE_KEY
,
array_keys
(
$data
));
...
...
app/code/community/EcomDev/PHPUnit/Model/Mysql4/Fixture/Attribute/Abstract.php
View file @
e43bf5d0
...
...
@@ -15,6 +15,7 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* @author Ivan Chepurnyi <ivan.chepurnyi@ecomdev.org>
* @author Steve Rice <srice@endertech.com>
* @author Jonathan Day <jonathan@aligent.com.au>
*/
abstract
class
EcomDev_PHPUnit_Model_Mysql4_Fixture_Attribute_Abstract
...
...
@@ -153,9 +154,9 @@ abstract class EcomDev_PHPUnit_Model_Mysql4_Fixture_Attribute_Abstract
throw
new
Exception
(
'Attribute array cannot be empty'
);
}
else
{
$a
A
ttributeCodes
=
array
();
foreach
(
$attributes
[
$entityType
]
as
$a
A
ttribute
){
$a
AttributeCodes
[]
=
$aA
ttribute
[
'attribute_code'
];
$attributeCodes
=
array
();
foreach
(
$attributes
[
$entityType
]
as
$attribute
){
$a
ttributeCodes
[]
=
$a
ttribute
[
'attribute_code'
];
}
}
//delete entry from eav/attribute and allow FK cascade to delete all related values
...
...
@@ -165,7 +166,7 @@ abstract class EcomDev_PHPUnit_Model_Mysql4_Fixture_Attribute_Abstract
$this
->
getTable
(
'eav/attribute'
),
array
(
'entity_type_id = ?'
=>
$eavSetup
->
getEntityTypeId
(
$entityType
),
'attribute_code IN (?)'
=>
$a
A
ttributeCodes
,
'attribute_code IN (?)'
=>
$attributeCodes
,
)
);
$this
->
_getWriteAdapter
()
->
commit
();
...
...
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