Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
FlexStyleMicroKernel example
->
method
(
'getAlias'
)
->
willReturn
(
'framework'
)
;
$container
=
new
ContainerBuilder
(
)
;
$container
->
registerExtension
(
$frameworkExtension
)
;
$kernel
=
$this
->kernel =
new
ConcreteMicroKernel
(
'test', false
)
;
$kernel
->
registerContainerConfiguration
(
new
ClosureLoader
(
$container
)
)
;
$this
->
assertTrue
(
$container
->
getDefinition
(
'kernel'
)
->
hasTag
(
'routing.route_loader'
)
)
;
}
public
function
testFlexStyle
(
)
{
$kernel
=
new
FlexStyleMicroKernel
(
'test', false
)
;
$kernel
->
boot
(
)
;
$request
= Request::
create
(
'/'
)
;
$response
=
$kernel
->
handle
(
$request
)
;
$this
->
assertEquals
(
'Have a great day!',
$response
->
getContent
(
)
)
;
$request
= Request::
create
(
'/h'
)
;
$response
=
$kernel
->
handle
(
$request
)
;
$this
->
assertEquals
(
'Have a great day!',
$response
->
getContent
(
)
)
;