Example #1
0
 public function testCanExtractScoresForBulkText()
 {
     // setup
     // text is from Stuart Herbert's blog
     $textToScore = array('extract1' => "Many old-skool developers choose to work largely from the command-line. You can happily run PHPUnit by hand from the command line yourself each time, but if you’re taking advantage of the extra data that PHPUnit can report back on, that soon gets to be a lot of typing! This is where the build.xml file in our skeleton comes in handy …", 'extract2' => "If the command-line isn’t for you, don’t worry … the component skeleton is also designed to make it very easy to run your unit tests from inside Netbeans. I’m assuming that it will be just as easy to do this from other IDEs that support PHPUnit, but I haven’t tested any myself.");
     // do the test
     $client = new Client($this->_apiKey);
     $scores = $client->callBulkScore($textToScore);
     // evalute the results
     $this->assertTrue(isset($scores['extract1']));
     $this->assertTrue(isset($scores['extract2']));
 }