Alternc  latest
Alternc logiel libre pour l'h├ębergement
 All Classes Namespaces Files Functions Variables Pages
AlterncTest Class Reference

This is the abstract class for all tests. More...

+ Inheritance diagram for AlterncTest:

Public Member Functions

 getConnection ()
 
 loadDataSet ($fileList)
 

Detailed Description

This is the abstract class for all tests.

See also
http://phpunit.de/manual/

Definition at line 6 of file AlterncTest.php.

Member Function Documentation

AlterncTest::getConnection ( )
Returns
PHPUnit_Extensions_Database_DB_IDatabaseConnection

Definition at line 11 of file AlterncTest.php.

References $database, $password, and $user.

Referenced by m_actionTest\testArchive(), m_actionTest\testCancel(), m_actionTest\testChmod(), m_actionTest\testCreate_dir(), m_actionTest\testCreate_file(), m_actionTest\testDel(), m_variablesTest\testDel(), m_actionTest\testFinish(), m_actionTest\testFix_dir(), m_actionTest\testFix_file(), m_actionTest\testFix_user(), m_actionTest\testMove(), m_actionTest\testPurge(), m_actionTest\testReset_job(), m_actionTest\testSet(), m_variablesTest\testVariable_create(), and m_variablesTest\testVariable_update().

12  {
13  global $database,$user,$password;
14  $pdo = new PDO('mysql:dbname='.$database.';host=127.0.0.1',$user,$password);
15  return $this->createDefaultDBConnection($pdo);
16  }
$user
Definition: bootstrap.php:84
foreach(array(ALTERNC_MAIL, ALTERNC_HTML, ALTERNC_LOGS) as $crdir) $database
Definition: bootstrap.php:83
$password
Definition: bootstrap.php:85
AlterncTest::loadDataSet (   $fileList)
Parameters
string$fileList
Returns
Exceptions
Exception

Definition at line 24 of file AlterncTest.php.

References PHPUNIT_DATASETS_PATH.

Referenced by m_actionTest\testPurge(), and m_variablesTest\testVariable_update().

25  {
26  if (empty($fileList)) {
27  throw new \Exception("No files specified");
28  }
29  if( !is_array($fileList)){
30  $fileList = array($fileList);
31  }
32  $datasetList = array();
33  foreach ($fileList as $file_name) {
34  $file = PHPUNIT_DATASETS_PATH."/$file_name";
35  if( !is_file($file) ){
36  throw new \Exception("missing $file");
37  }
38  $dataSet = new PHPUnit_Extensions_Database_DataSet_YamlDataSet($file);
39  $datasetList[] = $dataSet;
40  }
41  $compositeDataSet = new PHPUnit_Extensions_Database_DataSet_CompositeDataSet($datasetList);
42  return $dataSet;
43  }
const PHPUNIT_DATASETS_PATH
Definition: bootstrap.php:20

The documentation for this class was generated from the following file: