当前位置: 首页>>代码示例>>PHP>>正文


PHP kXml::openXmlFile方法代码示例

本文整理汇总了PHP中kXml::openXmlFile方法的典型用法代码示例。如果您正苦于以下问题:PHP kXml::openXmlFile方法的具体用法?PHP kXml::openXmlFile怎么用?PHP kXml::openXmlFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kXml的用法示例。


在下文中一共展示了kXml::openXmlFile方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fromXml

 /**	
  * 
  * Generates a new KalturaTestsFailures object from a given failure file path 
  * @param string $failureFilePath
  */
 public function fromXml($failureFilePath)
 {
     $simpleXML = kXml::openXmlFile($failureFilePath);
     foreach ($simpleXML->Failures->UnitTestFailures as $unitTestFailureXml) {
         $this->testCaseFailures[] = KalturaTestCaseFailure::generateFromXml($unitTestFailureXml);
     }
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:12,代码来源:KalturaTestFailures.php

示例2: provider

 /**
  * 
  * The test data provider (gets the data for the different tests)
  * @param string $className - The class name
  * @param string $procedureName - The current method (test) name
  * @return array<array>();
  */
 public function provider($className, $procedureName)
 {
     //print("In provider for $className, $procedureName \n");
     //Gets from the given class the class data file
     $class = get_class($this);
     $classFilePath = KAutoloader::getClassFilePath($class);
     $testClassDir = dirname($classFilePath);
     $dataFilePath = $testClassDir . DIRECTORY_SEPARATOR . "testsData/{$className}.data";
     KalturaLog::debug("The data file path [" . $dataFilePath . "]");
     if (file_exists($dataFilePath)) {
         $simpleXML = kXml::openXmlFile($dataFilePath);
     } else {
         //TODO: Give notice or create the file don't throw an exception
         throw new Exception("Data file [{$dataFilePath}] not found");
     }
     $inputsForTestProcedure = array();
     foreach ($simpleXML->TestProcedureData as $xmlTestProcedureData) {
         if ($xmlTestProcedureData["testProcedureName"] != $procedureName) {
             continue;
         }
         foreach ($xmlTestProcedureData->TestCaseData as $xmlTestCaseData) {
             $testCaseInstanceInputs = array();
             foreach ($xmlTestCaseData->Input as $input) {
                 $object = KalturaTestDataObject::generatefromXml($input);
                 //Add the new input to the test case instance data
                 $testCaseInstanceInputs[] = $object;
             }
             foreach ($xmlTestCaseData->OutputReference as $output) {
                 $object = KalturaTestDataObject::generatefromXml($output);
                 //Add the new output reference to the test case instance data
                 $testCaseInstanceInputs[] = $object;
             }
             //Add the test case into the test procedure data
             $inputsForTestProcedure[] = $testCaseInstanceInputs;
         }
     }
     KalturaLog::info("Tests data provided Before transformation to objects: \n[" . print_r($inputsForTestProcedure, true) . "]");
     $inputsForTestProcedure = $this->transformToObjects($inputsForTestProcedure);
     KalturaLog::info("Tests data provided [" . print_r($inputsForTestProcedure, true) . "]");
     return $inputsForTestProcedure;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:48,代码来源:KalturaTestCaseBase.php

示例3: __construct

 /**
  * Creates a new Kaltura objects DataGenerator
  * Gets The file path to it's configuration file
  * 
  * @param string $dataGeneratorConfigFilePath the config file path
  */
 public function __construct($dataGeneratorConfigFilePath)
 {
     $simpleXMLElement = kXml::openXmlFile($dataGeneratorConfigFilePath);
     $this->dataSourceFile = KalturaTestDataSourceFile::generateFromXML($simpleXMLElement);
     $this->dataSourceFile->setFilePath($dataGeneratorConfigFilePath);
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:12,代码来源:KalturaTestDataGenerator.php

示例4: __construct

 /**
  * Creates a new Kaltura objects DataGenerator
  * Gets The file path to it's configuration file
  * 
  * @param string $dataGeneratorConfigFilePath the config file path
  */
 public function __construct($dataGeneratorConfigFilePath)
 {
     $simpleXMLElement = kXml::openXmlFile($dataGeneratorConfigFilePath);
     $this->generatorConfigFile = KalturaDataGeneratorConfigFile::generateFromXML($simpleXMLElement);
     $this->generatorConfigFile->filePath = $dataGeneratorConfigFilePath;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:12,代码来源:KalturaUnitTestDataGenerator.php

示例5: fromXml

 /**	
  * 
  * Generates a new KalturaTestsFailures object from a given failure file path 
  * @param string $failureFilePath
  */
 public function fromXml($failureFilePath)
 {
     $simpleXML = kXml::openXmlFile($failureFilePath);
     $this->testCaseName = $simpleXML["TestCaseName"];
     foreach ($simpleXML->TestProcedureFailures as $testProcedureFailureXml) {
         $testProcedureFailure = KalturaTestProcedureFailure::generateFromXml($testProcedureFailureXml);
         $this->testProceduresFailures[$testProcedureFailure->getTestProcedureName()] = $testProcedureFailure;
     }
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:14,代码来源:KalturaTestCaseFailures.php

示例6: fromDataXml

 /**
  * 
  * Sets the object from a given data xml
  */
 public function fromDataXml($dataFilePath)
 {
     KalturaLog::debug("Data file path [" . $dataFilePath . "]\n");
     $simpleXmlElement = kXml::openXmlFile($dataFilePath);
     $this->testCaseName = (string) $simpleXmlElement["testCaseName"];
     KalturaLog::debug("data file [" . $simpleXmlElement->asXML() . "]\n");
     foreach ($simpleXmlElement->TestProcedureData as $xmlTestProcedureData) {
         $testProcedureData = KalturaTestProcedureData::generateFromDataXml($xmlTestProcedureData);
         $this->testProceduresData[$testProcedureData->getProcedureName()] = $testProcedureData;
     }
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:15,代码来源:KalturaTestCaseDataFile.php

示例7: fromDataXml

 /**
  * 
  * Sets the object from a given data xml
  */
 public function fromDataXml($dataFilePath)
 {
     $simpleXmlElement = kXml::openXmlFile($dataFilePath);
     $this->fileName = $dataFilePath;
     foreach ($simpleXmlElement->UnitTestsData->UnitTestData as $unitTestDataXml) {
         $unitTestData = KalturaUnitTestData::generateFromDataXml($unitTestDataXml);
         $this->unitTestsData[] = $unitTestData;
     }
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:13,代码来源:KalturaUnitTestDataFile.php


注:本文中的kXml::openXmlFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。