public static function findNumericValue($const) { $table = self::loadCurlConstantsTable(); $const = strtoupper($const); if (!isset($table[$const])) { throw new Exception('Constant CURLOPT_' . $const . ' does not exist.'); } return $table[$const]; }
public function testFindNumericValue() { $this->assertEquals(CURLOPT_TIMEOUT, ConstantsTable::findNumericValue('TiMEOUT')); $this->assertEquals(CURLOPT_FTP_CREATE_MISSING_DIRS, ConstantsTable::findNumericValue('FTPCreateMissingDirs')); }