示例#1
0
 /**
  * @param $scope
  *
  * @return $this
  * @throws \Exception
  * @author     Andreas Glaser
  *
  * @deprecated Not supported in HTML5. http://www.w3schools.com/tags/att_td_scope.asp
  */
 public function setScope($scope)
 {
     $validScopes = ['col', 'row', 'colgroup', 'rowgroup'];
     if (!StringHelper::isOneOf($scope, $validScopes)) {
         throw new \Exception(sprintf('"%s" is not a valid <td> scope. Valid are: %s', $scope, implode(', ', $validScopes)));
     }
     $this->attributes->set('scope', $scope);
     return $this;
 }
 /**
  * @author Andreas Glaser
  */
 public function testIsOneOf()
 {
     $this->assertTrue(StringHelper::isOneOf($this->testString, ['Hello there, this is a test string.', 'cheese'], true));
     $this->assertFalse(StringHelper::isOneOf($this->testString, ['Hell', 'cheese'], true));
     $this->assertTrue(StringHelper::isOneOf($this->testString, ['Hello there, THIS is a test string.', 'cheese'], false));
 }