本文整理汇总了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);
}
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
}
示例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;
}
}
示例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;
}
}