Ejemplo n.º 1
0
 /**
  * Test Candidate::validatePSCID with both valid and invalid PSCID
  *
  * @covers Candidate::validatePSCID
  * @return void
  */
 public function testValidatePSCID()
 {
     $seq = array('seq' => array(0 => array('#' => '', '@' => array('type' => 'siteAbbrev')), 1 => array('#' => '', '@' => array('type' => 'numeric', 'minLength' => '4'))));
     $this->_configMap = array(array('PSCID', array('generation' => 'sequential', 'structure' => $seq)));
     $this->_configMock->method('getSetting')->will($this->returnValueMap($this->_configMap));
     $this->assertEquals(1, Candidate::validatePSCID('AAA0012', 'AAA'), 'Valid PSCID: validatePSCID should return 1');
     $this->assertEquals(0, Candidate::validatePSCID('AAA001', 'AAA'), 'Invalid PSCID: validatePSCID should return 0');
 }