Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
inner example
use
PHPUnit\Framework\TestCase;
use
Symfony\Component\Scheduler\Trigger\ExcludeTimeTrigger;
use
Symfony\Component\Scheduler\Trigger\JitterTrigger;
use
Symfony\Component\Scheduler\Trigger\TriggerInterface;
class
AbstractDecoratedTriggerTest
extends
TestCase
{
public
function
testCanGetInnerTrigger
(
)
{
$trigger
=
new
JitterTrigger
(
$inner
=
$this
->
createMock
(
TriggerInterface::
class
)
)
;
$this
->
assertSame
(
$inner
,
$trigger
->
inner
(
)
)
;
$this
->
assertSame
(
[
$trigger
]
,
iterator_to_array
(
$trigger
->
decorators
(
)
)
)
;
}
public
function
testCanGetNestedInnerTrigger
(
)
{
$trigger
=
new
ExcludeTimeTrigger
(
$jitter
=
new
JitterTrigger
(
$inner
=
$this
->
createMock
(
TriggerInterface::
class
)
)
,
new
\
DateTimeImmutable
(
)
,
new
\
DateTimeImmutable
(
)
,
)
;