FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
FixturesPlugin/src/FixtureTrait.php at main · basecom/FixturesPlugin · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
basecom
/
FixturesPlugin
Public
Notifications
You must be signed in to change notification settings
Fork
4
Star
19
Code
Issues
2
Pull requests
2
Discussions
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
FixturesPlugin
/
src
/
FixtureTrait.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
57 lines (44 loc) · 1.52 KB
Breadcrumbs
FixturesPlugin
/
src
/
FixtureTrait.php
Copy path
File metadata and controls
57 lines (44 loc) · 1.52 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
declare
(strict_types=
1
);
namespace
Basecom
\
FixturePlugin
;
use
Shopware
\
Core
\
Framework
\
DependencyInjection
\
DependencyInjectionException
;
use
Shopware
\
Core
\
Framework
\
Test
\
TestCaseBase
\
IntegrationTestBehaviour
;
trait
FixtureTrait
{
use
IntegrationTestBehaviour;
private
function
runFixtures
(
FixtureOption
$
options
):
void
{
$
fixtureLoader
=
$
this
->
getContainer
()->
get
(FixtureLoader::class);
if
(!
$
fixtureLoader
instanceof
FixtureLoader) {
throw
new
DependencyInjectionException
(
404
,
'
FIXTURE_LOADER_NOT_FOUND
'
,
'
Fixture Loader not found in container
'
);
}
$
fixtureLoader
->
run
(
$
options
);
}
/**
* @param array<string> $fixtures
*/
private
function
runSpecificFixtures
(
array
$
fixtures
= [],
bool
$
withDependencies
=
false
):
void
{
$
options
=
new
FixtureOption
(
fixtureNames:
$
fixtures
,
withDependencies:
$
withDependencies
,
);
$
this
->
runFixtures
(
$
options
);
}
private
function
runSingleFixture
(
string
$
fixture
,
bool
$
withDependencies
=
false
):
void
{
$
options
=
new
FixtureOption
(
fixtureNames: [
$
fixture
],
withDependencies:
$
withDependencies
,
);
$
this
->
runFixtures
(
$
options
);
}
private
function
runFixtureGroup
(
string
$
group
,
bool
$
withDependencies
=
false
):
void
{
$
options
=
new
FixtureOption
(
groupName:
$
group
,
withDependencies:
$
withDependencies
,
);
$
this
->
runFixtures
(
$
options
);
}
}
Back
|
FazBrowse Home
|
New Git URL