Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getRobots example
$this
->
createMock
(
AddressValidationFactory::
class
)
,
$this
->
createMock
(
DataValidator::
class
)
)
;
$page
=
$checkoutConfirmPageLoader
->
load
(
new
Request
(
)
,
$this
->
getContextWithDummyCustomer
(
)
)
;
static
::
assertInstanceOf
(
CheckoutConfirmPage::
class
,
$page
)
;
static
::
assertNotNull
(
$page
->
getMetaInformation
(
)
)
;
static
::
assertSame
(
'noindex,follow',
$page
->
getMetaInformation
(
)
->
getRobots
(
)
)
;
}
public
function
testRobotsMetaNotSetIfGiven
(
)
: void
{
$page
=
new
CheckoutConfirmPage
(
)
;
$pageLoader
=
$this
->
createMock
(
GenericPageLoader::
class
)
;
$pageLoader
->
method
(
'load'
)
->
willReturn
(
$page
)
;
$pageLoader
,
$this
->
createMock
(
ShippingMethodRoute::
class
)
)
;
$page
=
$offcanvasCartPageLoader
->
load
(
new
Request
(
)
,
$this
->
createMock
(
SalesChannelContext::
class
)
)
;
static
::
assertInstanceOf
(
OffcanvasCartPage::
class
,
$page
)
;
static
::
assertNotNull
(
$page
->
getMetaInformation
(
)
)
;
static
::
assertSame
(
'noindex,follow',
$page
->
getMetaInformation
(
)
->
getRobots
(
)
)
;
}
public
function
testRobotsMetaNotSetIfGiven
(
)
: void
{
$page
=
new
OffcanvasCartPage
(
)
;
$pageLoader
=
$this
->
createMock
(
GenericPageLoader::
class
)
;
$pageLoader
->
method
(
'load'
)
->
willReturn
(
$page
)
;
'changedPayment' => false,
'paymentFailed' => false,
]
)
;
$page
=
$checkoutFinishPageLoader
->
load
(
$request
,
$this
->
getContextWithDummyCustomer
(
)
,
)
;
static
::
assertInstanceOf
(
CheckoutFinishPage::
class
,
$page
)
;
static
::
assertNotNull
(
$page
->
getMetaInformation
(
)
)
;
static
::
assertSame
(
'noindex,follow',
$page
->
getMetaInformation
(
)
->
getRobots
(
)
)
;
}
public
function
testCheckoutFinishPageReturned
(
)
: void
{
$orderId
= Uuid::
randomHex
(
)
;
$pageLoader
=
$this
->
createMock
(
GenericPageLoader::
class
)
;
$pageLoader
->
method
(
'load'
)
->
willReturn
(
new
Page
(
)
)
;
$checkoutFinishPageLoader
=
new
CheckoutFinishPageLoader
(