Permalink
Browse files

Added a test covering the selection with reset in multiple select boxes

  • Loading branch information...
1 parent 1dbc03c commit d4cecf5a9753cd32915bce177e2722874599617b @stof stof committed May 17, 2014
Showing with 16 additions and 0 deletions.
  1. +10 −0 driver-testsuite/tests/Form/SelectTest.php
  2. +6 −0 driver-testsuite/web-fixtures/multiselect_form.html
@@ -14,12 +14,15 @@ public function testMultiselect()
$select = $page->findField('select_number');
$multiSelect = $page->findField('select_multiple_numbers[]');
+ $secondMultiSelect = $page->findField('select_multiple_values[]');
$this->assertNotNull($select);
$this->assertNotNull($multiSelect);
+ $this->assertNotNull($secondMultiSelect);
$this->assertEquals('20', $select->getValue());
$this->assertSame(array(), $multiSelect->getValue());
+ $this->assertSame(array('2', '3'), $secondMultiSelect->getValue());
$select->selectOption('thirty');
$this->assertEquals('30', $select->getValue());
@@ -32,6 +35,9 @@ public function testMultiselect()
$this->assertEquals(array('1', '3'), $multiSelect->getValue());
+ $secondMultiSelect->selectOption('two');
+ $this->assertSame(array('2'), $secondMultiSelect->getValue());
+
$button = $page->findButton('Register');
$this->assertNotNull($button);
$button->press();
@@ -44,6 +50,10 @@ public function testMultiselect()
0 = '1',
1 = '3',
),
+ 'select_multiple_values' =$space
+ array (
+ 0 = '2',
+ ),
'select_number' = '30',
OUT;
$this->assertContains($out, $page->getContent());
@@ -20,6 +20,12 @@
<option value="3">three</option>
</select>
+ <select name="select_multiple_values[]" multiple="multiple">
+ <option value="1">one</option>
+ <option value="2" selected="selected">two</option>
+ <option value="3" selected="selected">three</option>
+ </select>
+
<input type="submit" name="submit" value="Register" />
</form>
</body>

0 comments on commit d4cecf5

Please sign in to comment.