Alternc  3.2
Alternc logiel libre pour l'h├ębergement
 All Data Structures Namespaces Files Functions Variables Pages
m_variablesTest Class Reference

Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2014-03-13 at 15:55:59. More...

+ Inheritance diagram for m_variablesTest:

Public Member Functions

 getDataSet ()
 testVariable_init ($variables)
 m_variables::variable_init testGet_impersonated
 testGet_impersonated ()
 m_variables::get_impersonated
 testVariable_init_maybe ()
 m_variables::variable_init_maybe
 testVariable_get ()
 m_variables::variable_get
 testVariable_create_exception ()
 m_variables::variable_update_or_create
 testVariable_create ()
 m_variables::variable_update_or_create
 testVariable_update ()
 m_variables::variable_update_or_create
 testDel ()
 m_variables::del
 testDisplay_valueraw_html ()
 m_variables::display_valueraw_html
 testDisplay_value_html ($variables)
 m_variables::display_value_html testVariables_list
 testVariables_list_name ()
 m_variables::variables_list_name
 testVariables_list ()
 m_variables::variables_list
- Public Member Functions inherited from AlterncTest
 getConnection ()
 loadDataSet ($file_name)

Protected Member Functions

 setUp ()
 Sets up the fixture, for example, opens a network connection.
 tearDown ()
 Tears down the fixture, for example, closes a network connection.

Protected Attributes

 $object

Detailed Description

Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2014-03-13 at 15:55:59.

Definition at line 5 of file m_variablesTest.php.

Member Function Documentation

getDataSet ( )
Returns
PHPUnit_Extensions_Database_DataSet_IDataSet

Definition at line 15 of file m_variablesTest.php.

References AlterncTest\loadDataSet().

{
return parent::loadDataSet("variables.yml");
}
setUp ( )
protected

Sets up the fixture, for example, opens a network connection.

This method is called before a test is executed.

Definition at line 24 of file m_variablesTest.php.

{
$this->object = new m_variables;
}
tearDown ( )
protected

Tears down the fixture, for example, closes a network connection.

This method is called after a test is executed.

Definition at line 34 of file m_variablesTest.php.

testDel ( )

m_variables::del

Definition at line 117 of file m_variablesTest.php.

References AlterncTest\getConnection().

{
$result = $this->object->del(999);
$this->assertTrue($result);
$this->assertEquals(0, $this->getConnection()->getRowCount('variable'));
}
testDisplay_value_html (   $variables)

m_variables::display_value_html testVariables_list

Definition at line 148 of file m_variablesTest.php.

References $variables.

{
$valid_result = $this->object->display_value_html($variables, "DEFAULT", 0, "phpunit",FALSE);
$this->assertStringMatchesFormat("phpunit",$valid_result);
$invalid_result = $this->object->display_value_html($variables, "DEFAULT", 0, "phpunit-absent",FALSE);
$this->assertStringMatchesFormat("<em>"._("None defined")."</em>",$invalid_result);
}
testDisplay_valueraw_html ( )

m_variables::display_valueraw_html

Definition at line 127 of file m_variablesTest.php.

{
// Empty string
$empty_result = $this->object->display_valueraw_html(null, "phpunit",FALSE);
$this->assertStringMatchesFormat("<em>"._("Empty")."</em>",$empty_result);
// Empty array
$empty_array_result = $this->object->display_valueraw_html(array(), "phpunit",FALSE);
$this->assertStringMatchesFormat("<em>"._("Empty array")."</em>",$empty_array_result);
// String
$value_result = $this->object->display_valueraw_html("value", "phpunit",FALSE);
$this->assertStringMatchesFormat($value_result,$value_result);
// String
$array_result = $this->object->display_valueraw_html(array("value","value"), "phpunit",FALSE);
$this->assertStringMatchesFormat("<ul>%s</ul>",$array_result);
}
testGet_impersonated ( )

m_variables::get_impersonated

Definition at line 53 of file m_variablesTest.php.

References $variables.

{
$variables = $this->object->get_impersonated();
return $variables;
}
testVariable_create ( )

m_variables::variable_update_or_create

Definition at line 91 of file m_variablesTest.php.

References AlterncTest\getConnection().

{
// Insert key with new key : success
$result = $this->object->variable_update_or_create("phpunit-success","phpunit","DEFAULT",0);
$this->assertTrue($result);
$this->assertEquals(2, $this->getConnection()->getRowCount('variable'));
}
testVariable_create_exception ( )

m_variables::variable_update_or_create

Definition at line 82 of file m_variablesTest.php.

{
// Insert key with already existing key : success
$result = $this->object->variable_update_or_create("phpunit","phpunit-fail","DEFAULT",0);
}
testVariable_get ( )

m_variables::variable_get

Definition at line 72 of file m_variablesTest.php.

{
$result = $this->object->variable_get("phpunit");
$this->assertStringMatchesFormat("phpunit",$result);
}
testVariable_init (   $variables)

m_variables::variable_init testGet_impersonated

Definition at line 43 of file m_variablesTest.php.

References $conf.

{
$this->object->variable_init();
global $conf;
$this->assertTrue(is_array($conf));
}
testVariable_init_maybe ( )

m_variables::variable_init_maybe

Definition at line 62 of file m_variablesTest.php.

References $conf.

{
$this->object->variable_init_maybe();
global $conf;
$this->assertTrue(is_array($conf));
}
testVariable_update ( )

m_variables::variable_update_or_create

Definition at line 103 of file m_variablesTest.php.

References AlterncTest\getConnection(), and AlterncTest\loadDataSet().

{
$result = $this->object->variable_update_or_create("phpunit","phpunit-updated","DEFAULT",0,999);
$this->assertTrue($result);
$this->assertEquals(1, $this->getConnection()->getRowCount('variable'));
$expectedTable = $this->loadDataSet("variables-updated.yml")->getTable("variable");
$currentTable = $this->getConnection()->createQueryTable('variable', 'SELECT * FROM variable');
$this->assertTablesEqual($expectedTable, $currentTable);
}
testVariables_list ( )

m_variables::variables_list

Todo:
Implement testVariables_list().

Definition at line 173 of file m_variablesTest.php.

References $variables.

{
$variables = $this->object->variables_list();
$this->assertTrue(is_array($variables));
return $variables;
}
testVariables_list_name ( )

m_variables::variables_list_name

Todo:
Implement testVariables_list_name().

Definition at line 162 of file m_variablesTest.php.

References $variables.

{
$variables = $this->object->variables_list_name();
$this->assertTrue(is_array($variables));
return $variables;
}

Field Documentation

$object
protected

Definition at line 10 of file m_variablesTest.php.


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