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
c6a03a8d
Commit
c6a03a8d
authored
Aug 26, 2014
by
Ivan Chepurnyi
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #196 from fooman/fixture-array-merge
Fixture array merge
parents
f277572c
66959262
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
1 deletion
+66
-1
app/code/community/EcomDev/PHPUnit/Model/Fixture.php
app/code/community/EcomDev/PHPUnit/Model/Fixture.php
+1
-1
app/code/community/EcomDev/PHPUnitTest/Test/Model/Fixture.php
...code/community/EcomDev/PHPUnitTest/Test/Model/Fixture.php
+26
-0
app/code/community/EcomDev/PHPUnitTest/Test/Model/Fixture/fixtures/testFixtureArrayMerge.yaml
...st/Test/Model/Fixture/fixtures/testFixtureArrayMerge.yaml
+39
-0
No files found.
app/code/community/EcomDev/PHPUnit/Model/Fixture.php
View file @
c6a03a8d
...
@@ -412,7 +412,7 @@ class EcomDev_PHPUnit_Model_Fixture
...
@@ -412,7 +412,7 @@ class EcomDev_PHPUnit_Model_Fixture
if
(
empty
(
$this
->
_fixture
))
{
if
(
empty
(
$this
->
_fixture
))
{
$this
->
_fixture
=
$data
;
$this
->
_fixture
=
$data
;
}
else
{
}
else
{
$this
->
_fixture
=
array_
merg
e_recursive
(
$this
->
_fixture
,
$data
);
$this
->
_fixture
=
array_
replac
e_recursive
(
$this
->
_fixture
,
$data
);
}
}
return
$this
;
return
$this
;
...
...
app/code/community/EcomDev/PHPUnitTest/Test/Model/Fixture.php
0 → 100644
View file @
c6a03a8d
<?php
class
EcomDev_PHPUnitTest_Test_Model_Fixture
extends
EcomDev_PHPUnit_Test_Case
{
/**
* @loadFixture testFixtureArrayMerge.yaml
*/
public
function
testFixtureArrayMerge
()
{
require_once
(
$this
->
_getVfsUrl
(
'app/code/community/EcomDev/PHPUnit/Test/Model/ExampleClass.php'
));
$testCase
=
new
EcomDev_PHPUnitTest_Test_Model_ExampleClass
();
$testCase
->
setName
(
'testLoadFixtureOrder'
);
$this
->
getFixture
()
->
loadForClass
(
get_class
(
$testCase
));
$this
->
getFixture
()
->
loadByTestCase
(
$testCase
);
$this
->
getFixture
()
->
apply
();
}
protected
function
_getVfsUrl
(
$path
)
{
return
$this
->
getFixture
()
->
getVfs
()
->
url
(
$path
);
}
}
app/code/community/EcomDev/PHPUnitTest/Test/Model/Fixture/fixtures/testFixtureArrayMerge.yaml
0 → 100644
View file @
c6a03a8d
vfs
:
app
:
code
:
community
:
EcomDev
:
PHPUnit
:
Test
:
Model
:
ExampleClass.php
:
|
<?php
/**
* @loadSharedFixture sharedClassFixture.yaml
* @loadFixture classFixture.yaml
*/
class EcomDev_PHPUnitTest_Test_Model_ExampleClass extends EcomDev_PHPUnit_Test_Case
{
/**
* @loadSharedFixture sharedMethodFixture.yaml
* @loadFixture methodFixture.yaml
*/
public function testLoadFixtureOrder()
{
}
}
fixtures
:
classFixture.yaml
:
>
config:
default/sample/path: classFixtureValue
sharedClassFixture.yaml
:
>
config:
default/sample/path: sharedClassFixtureValue
sharedMethodFixture.yaml
:
>
config:
default/sample/path: sharedMethodFixtureValue
methodFixture.yaml
:
>
config:
default/sample/path: methodFixtureValue
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