예제 #1
0
 /**
  * Set the classes assigned to the body element.
  *
  * @param string $class One or more class names separated by spaces.
  * @throws \InvalidArgumentException If $class does not represent valid class name(s).
  */
 public function setClass($class = '')
 {
     $class = trim($class);
     if (is_string($class) && (empty($class) === true || Format::isClass($class) === true)) {
         $this->class = $class;
     } else {
         $msg = "The 'class' argument must be a valid class name, '" . $class . "' given";
         throw new InvalidArgumentException($msg);
     }
 }
 /**
  * @dataProvider invalidClassFormatProvider
  */
 public function testInvalidClassFormatProvider($string)
 {
     $this->assertFalse(Format::isClass($string));
 }