Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
EnvironmentRequirementsValidator example
$composer
=
$this
->
createMock
(
Composer::
class
)
;
$composer
->
method
(
'getRepositoryManager'
)
->
willReturn
(
$repoManagerMock
)
;
if
(
$coreComposerName
)
{
$composer
->
expects
(
static
::
never
(
)
)
->
method
(
'getPackage'
)
;
}
else
{
$composer
->
expects
(
static
::
once
(
)
)
->
method
(
'getPackage'
)
->
willReturn
(
$corePackage
)
;
}
$validator
=
new
EnvironmentRequirementsValidator
(
$composer
,
$systemEnvironment
)
;
$checks
=
new
RequirementsCheckCollection
(
)
;
static
::
assertEquals
(
$expectedChecks
,
$validator
->
validateRequirements
(
$checks
)
->
getElements
(
)
)
;
}
public
static
function
composerRequirementsProvider
(
)
: \Generator
{
$versionParser
=
new
VersionParser
(
)
;
yield
'platform repo with satisfied requirement' =>
[