示例#1
0
 /**
  * @runInSeparateProcess
  */
 public function testFindDocumentsWithOptions()
 {
     $limit = 1;
     $createdAfter = date('r', strtotime('-2 weeks'));
     $createdBefore = date('r', strtotime('-1 week'));
     $documentMock = m::mock('alias:\\Box\\View\\Document');
     $documents = [new \Box\View\Document(), new \Box\View\Document()];
     $options = ['limit' => $limit, 'createdAfter' => $createdAfter, 'createdBefore' => $createdBefore];
     $documentMock->shouldReceive('find')->with($this->client, $options)->andReturn($documents);
     $response = $this->client->findDocuments($options);
     $this->assertEquals($documents, $response);
 }