Beispiel #1
0
 /**
  * @dataProvider displayTypeProvider
  * 
  * @param mixed $value
  * @param string $expected
  */
 public function testDisplayType($value, $expected)
 {
     $this->assertEquals($expected, PhpUtils::displayType($value));
 }
Beispiel #2
0
 /**
  * @see \qtism\common\collections\AbstractCollection::checkType()
  */
 protected function checkType($value)
 {
     if (!RuntimeUtils::isQtiScalarDatatypeCompliant($value)) {
         $displayType = PhpUtils::displayType($value);
         $msg = "Cannot insert a non QTI Scalar Datatype into a QTI Container. The following Datatypes are accepted ";
         $msg .= "null, QTI Identifier, QTI Boolean, QTI Integer, QTI Float, QTI String, QTI Point, QTI Pair, QTI DirectedPair, ";
         $msg .= "QTI Duration, QTI File, QTI Uri, QTI IntOrIdentifier. '{$displayType}' given.";
         throw new InvalidArgumentException($msg);
     }
 }