/** * Checks the return of a callback to be of the expected type * @param string $classPath * @param mixed $returnValue * @return mixed * @throws \UnexpectedValueException */ static function returnIsA($classPath, $returnValue) { if ($returnValue instanceof $classPath) { return $returnValue; } throw new invalidReturn($returnValue, "Expected return of {$classPath}, got " . __PRIVATE__::getDescriptor($returnValue)); }
/** * @covers PHPixme\__PRIVATE__::getDescriptor * @requires extension curl */ public function test_getDescriptor_resource() { $handle = curl_init('http://www.wikipedia.com/'); self::assertEquals('curl', internal::getDescriptor($handle)); curl_close($handle); }