Example #1
0
<?php

require_once __DIR__ . '/../vendor/autoload.php';
use JsonRPC\Client;
$client = new Client('http://127.0.0.1/rpc');
$client->notify('example.notify');
echo 'Notify sended' . PHP_EOL;
Example #2
0
 /**
  *
  */
 public function testNotifyNotNamed()
 {
     $id = 3;
     $response = self::NOTIFICATION_RESPONSE;
     $request = $this->generateRequest($id, self::CALL_METHOD, $this->data, false, true);
     $transport = $this->getTransportMockSendRequest(self::HTTP_CODE_SUCCESS, $response);
     $client = new Client($transport);
     $result = $client->notify(self::CALL_METHOD, $this->data, false);
     $this->assertEquals("[request]{$request}[response]HTTP_CODE:200{$response}", $this->log);
     $this->assertTrue($result);
 }
Example #3
0
 public function testNotify()
 {
     $client = new Client(RPC_URL);
     $response = $client->notify('method.example', ['foo' => 'bar']);
     $this->assertEmpty($response);
 }