3 use Wikimedia\TestingAccessWrapper
;
6 * Test class for FormOptions initialization
7 * Ensure the FormOptions::add() does what we want it to do.
9 * Copyright © 2011, Antoine Musso
11 * @author Antoine Musso
13 class FormOptionsInitializationTest
extends \MediaWikiUnitTestCase
{
20 * A new fresh and empty FormOptions object to test initialization
23 protected function setUp() {
25 $this->object = TestingAccessWrapper
::newFromObject( new FormOptions() );
29 * @covers FormOptions::add
31 public function testAddStringOption() {
32 $this->object->add( 'foo', 'string value' );
36 'default' => 'string value',
38 'type' => FormOptions
::STRING,
42 $this->object->options
47 * @covers FormOptions::add
49 public function testAddIntegers() {
50 $this->object->add( 'one', 1 );
51 $this->object->add( 'negone', -1 );
58 'type' => FormOptions
::INT,
64 'type' => FormOptions
::INT,
67 $this->object->options