public function testInstance()
 {
     $instance = CustomLinkifyConfigurationSchema::instance();
     $defaults = $instance->defaults;
     $this->assertNull($defaults['AutoFormat.LinkifyWithTextLengthLimit.Limit']);
     $this->assertEquals(' ...', $defaults['AutoFormat.LinkifyWithTextLengthLimit.Suffix']);
     $this->assertTrue($defaults['AutoFormat.LinkifyWithTextLengthLimit.RemoveProtocol']);
 }
Пример #2
0
 /**
  * @expectedException Sutra\Component\Html\Exception\ProgrammerException
  * @expectedExceptionMessage If you are using HTML Purifier, this means you have not set 'autoFinalize' to false in HTML Purifier's configuration (try: `$purifier->config->autoFinalize = false`)
  */
 public function testConstructorBadConfiguration()
 {
     $utf8 = new Utf8Helper();
     $schema = CustomLinkifyConfigurationSchema::instance();
     $config = new PurifierConfiguration($schema);
     // Missing $config->autoFinalize = false here
     $helper = new HtmlHelper(new UrlParser($utf8), new Purifier($config));
     $helper->makeLinks('http://www.google.com http://www.amazon.com');
 }