コード例 #1
0
ファイル: StepTest.php プロジェクト: emildev35/processmaker
 public function getConnection()
 {
     if ($this->conn === null) {
         $dsn = 'mysql:dbname=' . $_SERVER['PM_UNIT_DB_NAME'] . ';host=' . $_SERVER['PM_UNIT_DB_HOST'];
         if (self::$pdo == null) {
             self::$pdo = new PDO($dsn, $_SERVER['PM_UNIT_DB_USER'], $_SERVER['PM_UNIT_DB_PASS']);
         }
         $this->conn = $this->createDefaultDBConnection(self::$pdo, $_SERVER['PM_UNIT_DB_NAME']);
     }
     return $this->conn;
 }
コード例 #2
0
        } catch (Exception $e) {
            return array('Exception!! ' => $e->getMessage());
        }
    }
    function LoadStep($data, $fields)
    {
        try {
            $Step = new Step();
            $result = $Step->load($fields['STEP_UID']);
            return $result;
        } catch (Exception $e) {
            return array('Exception!! ' => $e->getMessage());
        }
    }
    function RemoveStep($data, $fields)
    {
        try {
            $Step = new Step();
            $result = $Step->remove($fields['STEP_UID']);
            return $result;
        } catch (Exception $e) {
            return array('Exception!! ' => $e->getMessage());
        }
    }
}
$test = new StepTest('step.yml', $t);
$test->domain->addDomain('CREATED');
$test->load('CreateTestSteps');
$test->runAll();
$test->load('StepUnitTest');
$test->runAll();