示例#1
0
 /**
  * Test setData method sets data when passing variable name and value
  *
  * @return void
  * @covers Candidate::setData
  * @covers Candidate::getData
  */
 public function testSetDataWithValueSucceeds()
 {
     $this->_setUpTestDoublesForSelectCandidate();
     $this->_candidate->select($this->_candidateInfo['CandID']);
     $data = array('RegisteredBy' => 'TestUser');
     //assert update method is called with correct parameters
     $this->_dbMock->expects($this->once())->method('update')->with('candidate', $data, array('CandID' => $this->_candidateInfo['CandID']));
     $this->assertTrue($this->_candidate->setData('RegisteredBy', 'TestUser'));
     $this->assertEquals($data['RegisteredBy'], $this->_candidate->getData('RegisteredBy'));
 }