Ejemplo n.º 1
0
 private function checkSubmissionProgress($jobids)
 {
     //$res = $unbabel->getLanguagePairs();
     sleep(30);
     foreach ($jobids as $jobid) {
         //Sleep for 30 seconds and check to make sure the job is in progress
         $res = $this->unbabel->getTranslation($jobid);
         $this->assertEquals($res->getStatusCode(), 200);
         $job = $res->json();
         $this->assertEquals($job['status'], Unbabel::NEW_);
     }
     sleep(60);
     foreach ($jobids as $jobid) {
         //Sleep for 60 more seconds to make sure the job is done
         $res = $this->unbabel->getTranslation($jobid);
         $job = $res->json();
         $this->assertEquals($job['status'], Unbabel::READY);
     }
 }
Ejemplo n.º 2
0
 public function testItShouldGetWordCount()
 {
     $text = 'beep beep, I am a robot.';
     $this->httpDriver->expects($this->once())->method('post')->with($this->unbabel->buildRequestUrl('/wordcount/'), $this->unbabel->getHeaders(), json_encode(array('text' => $text)));
     $this->unbabel->getWordCount($text);
 }