Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getJsonResponseResult example
class
UsageDataControllerTest
extends
TestCase
{
public
function
testApprovalIsNotNeeded
(
)
: void
{
$detector
=
$this
->
createMock
(
ApprovalDetector::
class
)
;
$detector
->
method
(
'needsApprovalRequest'
)
->
willReturn
(
false
)
;
$controller
=
new
UsageDataController
(
$detector
)
;
static
::
assertFalse
(
$this
->
getJsonResponseResult
(
$controller
->
needsApprovalRequest
(
)
)
)
;
}
public
function
testApprovalIsNeededButWasAlreadyRequested
(
)
: void
{
$detector
=
$this
->
createMock
(
ApprovalDetector::
class
)
;
$detector
->
method
(
'needsApprovalRequest'
)
->
willReturn
(
true
)
;
$detector
->
method
(
'isApprovalAlreadyRequested'
)
->
willReturn
(
true
)
;
$controller
=
new
UsageDataController
(
$detector
)
;
static
::
assertFalse
(
$this
->
getJsonResponseResult
(
$controller
->
needsApprovalRequest
(
)
)
)
;
}