Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getDeltaName example
/** * @internal */
class
DomainsDeltaProviderTest
extends
TestCase
{
use
IntegrationTestBehaviour;
public
function
testGetName
(
)
: void
{
$expected
= 'domains';
static
::
assertSame
(
$expected
, DomainsDeltaProvider::DELTA_NAME
)
;
static
::
assertSame
(
$expected
,
(
new
DomainsDeltaProvider
(
)
)
->
getDeltaName
(
)
)
;
}
public
function
testGetDomainsDelta
(
)
: void
{
$context
= Context::
createDefaultContext
(
)
;
$manifest
=
$this
->
getTestManifest
(
)
;
$this
->
getAppLifecycle
(
)
->
install
(
$manifest
, false,
$context
)
;
$criteria
=
(
new
Criteria
(
)
)
->
addFilter
(
new
EqualsFilter
(
'name', 'test'
)
)
}
/** * @return array<string, array> */
public
function
getReports
(
Manifest
$manifest
, AppEntity
$app
)
: array
{
$deltas
=
[
]
;
foreach
(
$this
->deltaProviders
as
$provider
)
{
$deltas
[
$provider
->
getDeltaName
(
)
]
=
$provider
->
getReport
(
$manifest
,
$app
)
;
}
return
$deltas
;
}
public
function
requiresRenewedConsent
(
Manifest
$manifest
, AppEntity
$app
)
: bool
{
foreach
(
$this
->deltaProviders
as
$provider
)
{
if
(
$provider
->
hasDelta
(
$manifest
,
$app
)
)
{
return
true;
}
}
/** * @internal */
class
PermissionsDeltaProviderTest
extends
TestCase
{
use
IntegrationTestBehaviour;
public
function
testGetName
(
)
: void
{
$expected
= 'permissions';
static
::
assertSame
(
$expected
, PermissionsDeltaProvider::DELTA_NAME
)
;
static
::
assertSame
(
$expected
,
(
new
PermissionsDeltaProvider
(
)
)
->
getDeltaName
(
)
)
;
}
public
function
testGetPermissionsDelta
(
)
: void
{
$context
= Context::
createDefaultContext
(
)
;
$manifest
=
$this
->
getTestManifest
(
)
;
$this
->
getAppLifecycle
(
)
->
install
(
$manifest
, false,
$context
)
;
$criteria
=
(
new
Criteria
(
)
)
->
addFilter
(
new
EqualsFilter
(
'name', 'test'
)
)