/** * @covers \Magento\Braintree\Controller\Payment\GetNonce::execute */ public function testExecute() { $customerId = 1; $publicHash = '65b7bae0dcb690d93'; $nonce = 'f1hc45'; $this->request->expects(static::once())->method('getParam')->with('public_hash')->willReturn($publicHash); $this->session->expects(static::once())->method('getCustomerId')->willReturn($customerId); $this->commandResult->expects(static::once())->method('get')->willReturn(['paymentMethodNonce' => $nonce]); $this->command->expects(static::once())->method('execute')->willReturn($this->commandResult); $this->result->expects(static::once())->method('setData')->with(['paymentMethodNonce' => $nonce]); $this->logger->expects(static::never())->method('critical'); $this->result->expects(static::never())->method('setHttpResponseCode'); $this->action->execute(); }