/** * (non-PHPdoc) * @see Zend_Config::get() */ public function get($name, $default = null) { $value = parent::get($name, $default); $isGlobal = KalturaGlobalData::isGlobalData($value); if ($isGlobal) { $value = KalturaGlobalData::getData($value); } else { if ($value instanceof Zend_Config) { //We transform it to be a test configuration object so we can take global data from it $value = KalturaTestConfig::fromZendConfig($value); } } return $value; }
/** * * Compares the $actualValue with the $expectedValue on the given field / property, no Exception is thrown * @param string $fieldName * @param object $actualValue * @param object $expectedResult * @throws no exception can be thrown (for mass compares) */ public function compareOnField($fieldName, $actualValue, $expectedValue, $assertToPerform, $message = null) { try { $this->currentFailure = new KalturaFailure($fieldName, $actualValue, $expectedValue, $assertToPerform, $message); if (!is_null($expectedValue)) { $isGlobalData = KalturaGlobalData::isGlobalData($expectedValue); if ($isGlobalData) { $expectedValue = KalturaGlobalData::getData($expectedValue); } } $this->{$assertToPerform}($expectedValue, $actualValue, $this->currentFailure); } catch (PHPUnit_Framework_AssertionFailedError $e) { $this->hasFailures = true; $resultObject = $this->getTestResultObject(); if ($resultObject) { $resultObject->addFailure($this, $e, PHP_Timer::stop()); } else { $name = $this->getName(true); //print("In add failure Result is NULL for test [$name]\n"); } } catch (Exception $e) { $this->getTestResultObject()->addError($this, $e, PHP_Timer::stop()); } }
/** * * Clears a given name, if name = null clears all the names from the global data file * @param string $name */ public static function clearValue($name = null) { if (KalturaGlobalData::$dataFile == null) { $isInit = KalturaGlobalData::initDataFile(); if (!$isInit) { return null; } } if ($name) { if (is_string($name) || is_integer($name)) { $value = KalturaGlobalData::setData($name, null); KalturaLog::debug("Setting name [{$name}] to null"); } } else { self::$dataFile->clear($name); } }
protected static function addThumbnailAssetData(KalturaClient $client) { $entry = new KalturaMediaEntry(); $entry->name = "Entry For flavor asset test"; $entry->type = KalturaEntryType::MEDIA_CLIP; $entry->mediaType = KalturaMediaType::VIDEO; $defaultEntry = $client->media->add($entry, KalturaEntryType::MEDIA_CLIP); $contentResource = new KalturaUrlResource(); $contentResource->url = "http://sites.google.com/site/demokmc/Home/titanicin5seconds.flv"; $client->media->addContent($defaultEntry->id, $contentResource); KalturaGlobalData::setData("@DEFAULT_THUMBNAIL_ENTRY_ID@", $defaultEntry->id); }
/** * * Gets the admin kuser Id */ private function getAdminKuserId() { $partnerId = KalturaGlobalData::getData("@TEST_PARTNER_ID@"); $puserId = KalturaGlobalData::getData("TEST_PARTNER_USER_ID"); KuserPeer::getKuserByPartnerAndUid($partnerId, $puserId); }