public function testAddSingle() { $options = array(CURLOPT_URL => 'http://www.google.com/', CURLOPT_HEADER => false, CURLOPT_RETURNTRANSFER => true, CURLOPT_HEADER => 0, CURLOPT_USERAGENT => INIT::MATECAT_USER_AGENT . INIT::$BUILD_NUMBER, CURLOPT_CONNECTTIMEOUT => 2); $ch = curl_init(); curl_setopt_array($ch, $options); $mh = new MultiCurlHandler(); $tokenHash = $mh->addResource($ch); $this->assertNotEmpty($tokenHash); $mh->multiExec(); $singleContent = $mh->getSingleContent($tokenHash); $multiContent = $mh->getAllContents(); $this->assertNotEmpty($singleContent); $this->assertNotEmpty($multiContent); $this->assertEquals($singleContent, $multiContent[$tokenHash]); }