18 "testVariable_getNewWayArray" =>
"variables-empty.yml",
19 "testVariable_getNewWayString" =>
"variables-empty.yml",
20 "testVariable_getOldWay" =>
"variables-empty.yml",
21 "default" =>
"variables.yml" 23 if (isset(
$list[$this->getName()])) {
24 $dataset_file =
$list[$this->getName()];
26 $dataset_file =
"variables.yml";
28 return parent::loadDataSet($dataset_file);
39 $this->
object =
new m_variables;
57 $this->
object->variable_init();
59 $this->assertTrue(is_array($conf));
67 $variables = $this->
object->get_impersonated();
76 $this->
object->variable_init_maybe();
77 $this->assertTrue( (is_array($this->object->cache_conf) && !empty($this->object->cache_conf)) );
85 $result = $this->
object->variable_get(
"phpunit");
86 $this->assertStringMatchesFormat(
"phpunit",$result);
95 $this->
object->variable_get(
'phpunit',
'phpunit-default',
'phpunit-comment');
96 $result = $this->
object->variable_get(
'phpunit');
97 $this->assertSame(
"phpunit-default",$result);
108 $this->
object->variable_get(
'phpunit',
'phpunit-default',
'comment', array(
'desc'=>
'Want a string',
'type'=>
'string'));
109 $result = $this->
object->variable_get(
'phpunit');
110 $this->assertSame(
"phpunit-default",$result);
118 $phpunitArray = array(
"ns1"=>
'ns1.tld',
"ip"=>
"1.2.3.4");
119 $this->
object->variable_get(
'phpunit', $phpunitArray,
'phpunit-comment', array(
"ns1"=>array(
'desc'=>
'ns name',
'type'=>
'string'),
"ip"=>array(
"desc"=>
"here an ip",
"type"=>
"ip")));
120 $result = $this->
object->variable_get(
'phpunit');
121 $this->assertSame($phpunitArray,$result);
131 $result = $this->
object->variable_update_or_create(
"phpunit",
"phpunit-fail",
"DEFAULT",0);
140 $result = $this->
object->variable_update_or_create(
"phpunit-success",
"phpunit",
"DEFAULT",0);
141 $this->assertTrue($result);
142 $this->assertEquals(2, $this->
getConnection()->getRowCount(
'variable'));
151 $result = $this->
object->variable_update_or_create(
"phpunit",
"phpunit-updated",
"DEFAULT",0,999);
152 $this->assertTrue($result);
153 $this->assertEquals(1, $this->
getConnection()->getRowCount(
'variable'));
154 $expectedTable = $this->
loadDataSet(
"variables-updated.yml")->getTable(
"variable");
155 $currentTable = $this->
getConnection()->createQueryTable(
'variable',
'SELECT * FROM variable');
156 $this->assertTablesEqual($expectedTable, $currentTable);
165 $result = $this->
object->del(999);
166 $this->assertTrue($result);
167 $this->assertEquals(0, $this->
getConnection()->getRowCount(
'variable'));
176 $empty_result = $this->
object->display_valueraw_html(null,
"phpunit",FALSE);
177 $this->assertStringMatchesFormat(
"<em>"._(
"Empty").
"</em>",$empty_result);
179 $empty_array_result = $this->
object->display_valueraw_html(array(),
"phpunit",FALSE);
180 $this->assertStringMatchesFormat(
"<em>"._(
"Empty array").
"</em>",$empty_array_result);
182 $value_result = $this->
object->display_valueraw_html(
"value",
"phpunit",FALSE);
183 $this->assertStringMatchesFormat($value_result,$value_result);
185 $array_result = $this->
object->display_valueraw_html(array(
"value",
"value"),
"phpunit",FALSE);
186 $this->assertStringMatchesFormat(
"<ul>%s</ul>",$array_result);
196 $valid_result = $this->
object->display_value_html(
$variables,
"DEFAULT", 0,
"phpunit",FALSE);
197 $this->assertStringMatchesFormat(
"phpunit",$valid_result);
199 $invalid_result = $this->
object->display_value_html(
$variables,
"DEFAULT", 0,
"phpunit-absent",FALSE);
200 $this->assertStringMatchesFormat(
"<em>"._(
"None defined").
"</em>",$invalid_result);
210 $variables = $this->
object->variables_list_name();
testVariable_getNewWayString()
m_variables::variable_get
testVariable_get()
m_variables::variable_get
testVariable_create()
m_variables::variable_update_or_create
tearDown()
Tears down the fixture, for example, closes a network connection.
testVariable_init($variables)
m_variables::variable_init testGet_impersonated
testVariables_list()
m_variables::variables_list
testVariable_getNewWayArray()
m_variables::variable_get
testDel()
m_variables::del
testVariable_getOldWay()
m_variables::variable_get
testVariable_init_maybe()
m_variables::variable_init_maybe
testVariables_list_name()
m_variables::variables_list_name
if(! $admin->enabled) $conf
Manages global variables of AlternC.
This is the abstract class for all tests.
testDisplay_valueraw_html()
m_variables::display_valueraw_html
setUp()
Sets up the fixture, for example, opens a network connection.
testVariable_update()
m_variables::variable_update_or_create
testGet_impersonated()
m_variables::get_impersonated
$list
Show a list of all found log files for an account and allow to see / tail / download them...
testVariable_create_exception()
m_variables::variable_update_or_create
testDisplay_value_html( $variables)
m_variables::display_value_html testVariables_list
Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2014-03-13 at 15:55:59.