RpcCommunicationTest.php 773 B

1234567891011121314151617181920212223242526
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\MessageQueue\UseCase;
  7. class RpcCommunicationTest extends QueueTestCaseAbstract
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. protected $consumers = ['synchronousRpcTestConsumer'];
  13. /**
  14. * Verify that RPC call based on Rabbit MQ is processed correctly.
  15. *
  16. * Current test is not test of Web API framework itself, it just utilizes its infrastructure to test RPC.
  17. */
  18. public function testSynchronousRpcCommunication()
  19. {
  20. $input = 'Input value';
  21. $response = $this->publisher->publish('synchronous.rpc.test', $input);
  22. $this->assertEquals($input . ' processed by RPC handler', $response);
  23. }
  24. }