Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getTestManifest example
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'
)
)
->
addAssociation
(
'acl_role'
)
;
/** @var AppEntity $app */
$app
=
$this
->
getAppRepository
(
)
->
search
(
$criteria
,
$context
)
->
first
(
)
;
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'
)
)
->
addAssociation
(
'acl_role'
)
;
/** @var AppEntity $app */
$app
=
$this
->
getAppRepository
(
)
->
search
(
$criteria
,
$context
)
->
first
(
)
;
/** * @internal */
class
AppConfirmationDeltaProviderTest
extends
TestCase
{
use
IntegrationTestBehaviour;
public
function
testGetDeltas
(
)
: void
{
$deltas
=
$this
->
getAppConfirmationDeltaProvider
(
)
->
getReports
(
$this
->
getTestManifest
(
)
,
new
AppEntity
(
)
)
;
static
::
assertCount
(
2,
$deltas
)
;
static
::
assertArrayHasKey
(
'permissions',
$deltas
)
;
static
::
assertCount
(
6,
$deltas
[
'permissions'
]
)
;
static
::
assertArrayHasKey
(
'domains',
$deltas
)
;
static
::
assertCount
(
8,
$deltas
[
'domains'
]
)
;
}
public
function
testRequiresRenewedConsent
(
)
: void
{