public function testCreate()
 {
     $startDate = new DateTime();
     $endDate = new DateTime();
     $request = new AgreementAssetEventRequest($startDate, $endDate, 2, true);
     $request->addFilterEvent('SHARED');
     $request->addFilterEvent('FAXED_BY_SENDER');
     $output = $request->toArray();
     $this->assertEquals(api_date_format($startDate), $output['startDate']);
     $this->assertEquals(api_date_format($startDate), $output['endDate']);
     $this->assertEquals(2, $output['pageSize']);
     $this->assertTrue($output['onlyShowLatestEvent']);
     $this->assertEquals(2, count($output['filterEvents']));
 }
예제 #2
0
 /**
  * Create a search object for agreement asset event . It will return the result for the first page and search Id
  * to fetch results for further pages.
  * @param AgreementAssetEventRequest $eventRequest
  * @param string $userId
  * @param string $userEmail
  * @return AgreementAssetEventPostResponse
  */
 public function create(AgreementAssetEventRequest $eventRequest, $userId = null, $userEmail = null)
 {
     $this->setApiRequestUrl('agreementAssetEvents');
     $response = $this->simplePostRequest($eventRequest->toArray(), $userId, $userEmail);
     return new AgreementAssetEventPostResponse((array) $response);
 }