2010-02-22 07:11:58 +01:00
|
|
|
<?php
|
|
|
|
/**
|
2012-04-12 08:02:46 +02:00
|
|
|
* @package framework
|
2010-02-22 07:11:58 +01:00
|
|
|
* @subpackage tests
|
|
|
|
*/
|
|
|
|
class OptionsetFieldTest extends SapphireTest {
|
|
|
|
function testSetDisabledItems() {
|
|
|
|
$f = new OptionsetField(
|
|
|
|
'Test',
|
|
|
|
false,
|
|
|
|
array(0 => 'Zero', 1 => 'One')
|
|
|
|
);
|
|
|
|
|
|
|
|
$f->setDisabledItems(array(0));
|
|
|
|
$p = new CSSContentParser($f->Field());
|
|
|
|
$item0 = $p->getBySelector('#Test_0');
|
|
|
|
$item1 = $p->getBySelector('#Test_1');
|
|
|
|
$this->assertEquals(
|
|
|
|
(string)$item0[0]['disabled'],
|
|
|
|
'disabled'
|
|
|
|
);
|
|
|
|
$this->assertEquals(
|
|
|
|
(string)$item1[0]['disabled'],
|
|
|
|
''
|
|
|
|
);
|
|
|
|
}
|
2012-03-24 04:04:52 +01:00
|
|
|
}
|