Index: trunk/phase3/tests/phpunit/includes/XmlTest.php |
— | — | @@ -173,7 +173,3 @@ |
174 | 174 | ); |
175 | 175 | } |
176 | 176 | } |
177 | | - |
178 | | -// TODO |
179 | | -class XmlSelectTest extends MediaWikiTestCase { |
180 | | -} |
Index: trunk/phase3/tests/phpunit/includes/XmlSelectTest.php |
— | — | @@ -0,0 +1,40 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +// TODO |
| 5 | +class XmlSelectTest extends MediaWikiTestCase { |
| 6 | + protected $select; |
| 7 | + |
| 8 | + protected function setUp() { |
| 9 | + $this->select = new XmlSelect(); |
| 10 | + } |
| 11 | + protected function tearDown() { |
| 12 | + $this->select = null; |
| 13 | + } |
| 14 | + |
| 15 | + ### START OF TESTS ### |
| 16 | + |
| 17 | + public function testConstructWithoutParameters() { |
| 18 | + $this->assertEquals( '<select></select>', $this->select->getHTML() ); |
| 19 | + } |
| 20 | + |
| 21 | + # Begin XmlSelect::addOption() similar to Xml::option |
| 22 | + public function testAddOption() { |
| 23 | + $this->select->addOption( 'foo' ); |
| 24 | + $this->assertEquals( '<select><option value="foo">foo</option></select>', $this->select->getHTML() ); |
| 25 | + } |
| 26 | + |
| 27 | + public function testAddOptionWithDefault() { |
| 28 | + $this->select->addOption( 'foo', true ); |
| 29 | + $this->assertEquals( '<select><option value="1">foo</option></select>', $this->select->getHTML() ); |
| 30 | + } |
| 31 | + public function testAddOptionWithFalse() { |
| 32 | + $this->select->addOption( 'foo', false ); |
| 33 | + $this->assertEquals( '<select><option value="foo">foo</option></select>', $this->select->getHTML() ); |
| 34 | + } |
| 35 | + public function testAddOptionWithValueZero() { |
| 36 | + $this->select->addOption( 'foo', 0 ); |
| 37 | + $this->assertEquals( '<select><option value="0">foo</option></select>', $this->select->getHTML() ); |
| 38 | + } |
| 39 | + # End XmlSelect::addOption() similar to Xml::option |
| 40 | + |
| 41 | +} |
Property changes on: trunk/phase3/tests/phpunit/includes/XmlSelectTest.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 42 | + native |