45 $this->
object->variable_init();
47 $this->assertTrue(is_array($conf));
55 $variables = $this->
object->get_impersonated();
64 $this->
object->variable_init_maybe();
66 $this->assertTrue(is_array($conf));
74 $result = $this->
object->variable_get(
"phpunit");
75 $this->assertStringMatchesFormat(
"phpunit",$result);
85 $result = $this->
object->variable_update_or_create(
"phpunit",
"phpunit-fail",
"DEFAULT",0);
94 $result = $this->
object->variable_update_or_create(
"phpunit-success",
"phpunit",
"DEFAULT",0);
95 $this->assertTrue($result);
96 $this->assertEquals(2, $this->
getConnection()->getRowCount(
'variable'));
105 $result = $this->
object->variable_update_or_create(
"phpunit",
"phpunit-updated",
"DEFAULT",0,999);
106 $this->assertTrue($result);
107 $this->assertEquals(1, $this->
getConnection()->getRowCount(
'variable'));
108 $expectedTable = $this->
loadDataSet(
"variables-updated.yml")->getTable(
"variable");
109 $currentTable = $this->
getConnection()->createQueryTable(
'variable',
'SELECT * FROM variable');
110 $this->assertTablesEqual($expectedTable, $currentTable);
119 $result = $this->
object->del(999);
120 $this->assertTrue($result);
121 $this->assertEquals(0, $this->
getConnection()->getRowCount(
'variable'));
130 $empty_result = $this->
object->display_valueraw_html(null,
"phpunit",FALSE);
131 $this->assertStringMatchesFormat(
"<em>"._(
"Empty").
"</em>",$empty_result);
133 $empty_array_result = $this->
object->display_valueraw_html(array(),
"phpunit",FALSE);
134 $this->assertStringMatchesFormat(
"<em>"._(
"Empty array").
"</em>",$empty_array_result);
136 $value_result = $this->
object->display_valueraw_html(
"value",
"phpunit",FALSE);
137 $this->assertStringMatchesFormat($value_result,$value_result);
139 $array_result = $this->
object->display_valueraw_html(array(
"value",
"value"),
"phpunit",FALSE);
140 $this->assertStringMatchesFormat(
"<ul>%s</ul>",$array_result);
150 $valid_result = $this->
object->display_value_html(
$variables,
"DEFAULT", 0,
"phpunit",FALSE);
151 $this->assertStringMatchesFormat(
"phpunit",$valid_result);
153 $invalid_result = $this->
object->display_value_html(
$variables,
"DEFAULT", 0,
"phpunit-absent",FALSE);
154 $this->assertStringMatchesFormat(
"<em>"._(
"None defined").
"</em>",$invalid_result);
164 $variables = $this->
object->variables_list_name();