mirror of
				https://github.com/diocloid/LinkTitles.git
				synced 2025-10-22 05:42:32 +02:00 
			
		
		
		
	Test black list.
This commit is contained in:
		@@ -22,7 +22,7 @@ class LinkTitlesLinkerTest extends LinkTitles\TestCase {
 | 
			
		||||
  /**
 | 
			
		||||
   * @dataProvider provideLinkContentSmartModeData
 | 
			
		||||
   */
 | 
			
		||||
  public function testLinkContentSmartMode( $capitalLinks, $smartMode, $input, $expectedOutput) {
 | 
			
		||||
  public function testLinkContentSmartMode( $capitalLinks, $smartMode, $input, $expectedOutput ) {
 | 
			
		||||
    $this->setMwGlobals( 'wgCapitalLinks', $capitalLinks );
 | 
			
		||||
    $config = new LinkTitles\Config();
 | 
			
		||||
    $config->firstOnly = false;
 | 
			
		||||
@@ -130,4 +130,12 @@ class LinkTitlesLinkerTest extends LinkTitles\TestCase {
 | 
			
		||||
      ],
 | 
			
		||||
    ];
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public function testLinkContentBlackList() {
 | 
			
		||||
    $config = new LinkTitles\Config();
 | 
			
		||||
    $config->blackList = [ 'Foo', 'Link target', 'Bar' ];
 | 
			
		||||
    $linker = new LinkTitles\Linker( $config );
 | 
			
		||||
    $text = 'If the link target is blacklisted, it should not be linked';
 | 
			
		||||
    $this->assertSame( $text, $linker->linkContent( $this->title, $text ) );
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user