Lib_Test_TestFactory

The Gravity Forms Salesforce Add-On Lib Test TestFactory class.

Defined (1)

The class is defined in the following location(s).

/lib/Force.com-Toolkit-for-PHP/unit_test/Lib/Test/TestFactory.php  
  1. class Lib_Test_TestFactory 
  2. private $_logger; 
  3.  
  4. private $_soapDir; 
  5.  
  6. /** 
  7. *  
  8. * @param string $soapDir 
  9. * @param string $logName 
  10. * @return void 
  11. */ 
  12. public function __construct($soapDir, $logName) 
  13. $this->_logger = new Lib_Utils_FileLogger($logName, 'a+', TRUE); 
  14. $this->_soapDir = $soapDir; 
  15.  
  16. /** 
  17. * @param int $type 
  18. * @param string $target 
  19. * @return void 
  20. */ 
  21. public function run($type, $target) 
  22. $this->_logger->write(__METHOD__ . ' started'); 
  23.  
  24. $WsdlTypeEnum = new Lib_Enum_WsdlType(); 
  25. $typeName = $WsdlTypeEnum->getById($type); 
  26.  
  27. // create appropriate test instance and run it 
  28. $className = 'Lib_Test_' . ucfirst(strtolower($typeName)) . '_' . $target . 'Test'; 
  29.  
  30. /** @var $testCase Lib_Test_TestAbstract */ 
  31. $testCase = new $className($this->_soapDir); 
  32. $testCase->run($this->_logger); 
  33.  
  34. $this->_logger->write('Lib_Test_TestFactory->run finished'); 
  35.  
  36. public function runAll() 
  37. // TODO Implement 
  38. // Iterate throw all PARTNER and ENTERPRISE tests