/** * This uses our Node.js server to run actual tests against. */ public function testget_subjectMakesAHTTPRequest() { $server = $this->getServer(); $pp = new PP($this->getServer()->getUrl()); $payload = json_encode(array('test' => 'test')); $size = strlen($payload); // Enqueue the HTTP session. $this->getServer()->enqueue(array("HTTP/1.1 200 OK\r\n" . 'Date: ' . Utils::getHttpDate('now') . "\r\n" . "Last-Modified: Mon, 12 Nov 2012 02:53:38 GMT\r\n" . "Content-Length: {$size}\r\n\r\n{$payload}")); $this->assertNotEmpty($pp->get_subject_index(2014, 'undergraduate')); }