/**
* @internal
*
* @covers \Shopware\Core\System\UsageData\Api\UsageDataController
*/
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);