Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
assertObjectHasAttribute example
public
function
testGetMetadata
(
)
{
$this
->keyValue->
expects
(
$this
->
exactly
(
2
)
)
->
method
(
'get'
)
->
with
(
'test'
)
->
willReturnOnConsecutiveCalls
(
$this
->ownObject, FALSE
)
;
$metadata
=
$this
->tempStore->
getMetadata
(
'test'
)
;
$this
->
assertInstanceOf
(
Lock::
class
,
$metadata
)
;
$this
->
assertObjectHasAttribute
(
'updated',
$metadata
)
;
// Data should get removed.
$this
->
assertObjectNotHasAttribute
(
'data',
$metadata
)
;
$this
->
assertNull
(
$this
->tempStore->
getMetadata
(
'test'
)
)
;
}
/** * Tests the delete() method. * * @covers ::delete */
public
function
testGetMetadata
(
)
{
$this
->keyValue->
expects
(
$this
->
exactly
(
2
)
)
->
method
(
'get'
)
->
with
(
'1:test'
)
->
willReturnOnConsecutiveCalls
(
$this
->ownObject, FALSE
)
;
$metadata
=
$this
->tempStore->
getMetadata
(
'test'
)
;
$this
->
assertInstanceOf
(
Lock::
class
,
$metadata
)
;
$this
->
assertObjectHasAttribute
(
'ownerId',
$metadata
)
;
$this
->
assertObjectHasAttribute
(
'updated',
$metadata
)
;
// Data should get removed.
$this
->
assertObjectNotHasAttribute
(
'data',
$metadata
)
;
$this
->
assertNull
(
$this
->tempStore->
getMetadata
(
'test'
)
)
;
}
/** * Tests the locking in the delete() method. * * @covers ::delete */