public function testGetSelectedValue() { $FormConfig = getProperty('MailForm', 'FormConfig'); $mailform = new MailForm(); $this->assertEquals('', $mailform->getSelectedValue('key')); $mailform = $this->getMockBuilder('MailForm')->setMethods(array('getValue'))->getMock(); $mailform->expects($this->once())->method('getValue')->with('key')->will($this->returnValue('2')); $selectValues = array('empty' => 'empty', '1' => 'option1', '2' => 'option2'); $FormConfig->setValue($mailform, array('items' => array('key' => array('selectvalues' => $selectValues)))); $this->assertEquals('option2', $mailform->getSelectedValue('key')); }