mirror of
				https://github.com/diocloid/LinkTitles.git
				synced 2025-10-22 05:42:32 +02:00 
			
		
		
		
	Atom-ignore gh-pages directory.
This commit is contained in:
		
							
								
								
									
										1
									
								
								.atomignore
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								.atomignore
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
gh-pages/
 | 
			
		||||
							
								
								
									
										26
									
								
								tests/phpunit/TargetsTest.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								tests/phpunit/TargetsTest.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,26 @@
 | 
			
		||||
<?php
 | 
			
		||||
/**
 | 
			
		||||
 * Tests the LinkTitles\Targets class.
 | 
			
		||||
 *
 | 
			
		||||
 * @group bovender
 | 
			
		||||
 * @group Database
 | 
			
		||||
 */
 | 
			
		||||
class TargetsTest extends LinkTitles\TestCase {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * This test asserts that the list of potential link targets is 0
 | 
			
		||||
	 * @return [type] [description]
 | 
			
		||||
	 */
 | 
			
		||||
	public function testTargets() {
 | 
			
		||||
		$title = \Title::newFromText( 'link target' );
 | 
			
		||||
		$targets = LinkTitles\Targets::default( $title, new LinkTitles\Config() );
 | 
			
		||||
 | 
			
		||||
		// Count number of articles: Inspired by updateArticleCount.php maintenance
 | 
			
		||||
		// script: https://doc.wikimedia.org/mediawiki-core/master/php/updateArticleCount_8php_source.html
 | 
			
		||||
		$dbr = $this->getDB( DB_MASTER );
 | 
			
		||||
		$counter = new SiteStatsInit( $dbr );
 | 
			
		||||
		$count = $counter->articles();
 | 
			
		||||
 | 
			
		||||
		$this->assertSame( $targets->queryResult->numRows(), $count );
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user