コード例 #1
0
    public function testSendDocument()
    {
        $response = <<<EOS
            <document>
                <status>sent</status>
                <guid>2VMW88J3424MPEYF9DU6VY</guid>
            </document>
EOS;
        $payload = ['subject' => '- email subject -', 'action' => 'send', 'type' => 'base64', 'recipients' => ['recipient' => [['is_sender' => true, 'role' => 'cc'], ['name' => 'Signer 1', 'email' => '*****@*****.**', 'role' => 'signer']]]];
        $client = \Mockery::mock('client');
        $client->shouldReceive('post')->withAnyArgs()->andReturn($response);
        $tmp = tmpfile();
        fwrite($tmp, '- test document to sign -');
        $meta = stream_get_meta_data($tmp);
        $document = Document::send($client, $meta['uri'], $payload);
        $this->assertEquals('sent', $document['status']);
    }
コード例 #2
0
 /**
  * This method is for sending a once-off document that has not been setup as a Template.
  *
  * @param string $path Path of the document to send
  * @param array  $args Arguments to use as payload
  *
  * @return array
  */
 public function sendDocument($path, $args)
 {
     return Document::send($this->_client, $path, $args);
 }