<commit_before><?php

class MWEchoDbFactoryTest extends MediaWikiTestCase {

	public function testNewFromDefault() {
		$db = MWEchoDbFactory::newFromDefault();
		$this->assertInstanceOf( 'MWEchoDbFactory', $db );

		return $db;
	}

	/**
	 * @depends testNewFromDefault
	 */
	public function testGetEchoDb( MWEchoDbFactory $db ) {
		$this->assertInstanceOf( 'DatabaseBase', $db->getEchoDb( DB_MASTER ) );
		$this->assertInstanceOf( 'DatabaseBase', $db->getEchoDb( DB_REPLICA ) );
	}

	/**
	 * @depends testNewFromDefault
	 */
	public function testGetLB( MWEchoDbFactory $db ) {
		$reflection = new ReflectionClass( 'MWEchoDbFactory' );
		$method = $reflection->getMethod( 'getLB' );
		$method->setAccessible( true );
		$this->assertInstanceOf( 'LoadBalancer', $method->invoke( $db ) );
	}
<commit_msg>Check for IDatabase (not DatabaseBase) in tests<commit_after><?php

use Wikimedia\Rdbms\IDatabase;
use Wikimedia\Rdbms\ILoadBalancer;

class MWEchoDbFactoryTest extends MediaWikiTestCase {

	public function testNewFromDefault() {
		$db = MWEchoDbFactory::newFromDefault();
		$this->assertInstanceOf( 'MWEchoDbFactory', $db );

		return $db;
	}

	/**
	 * @depends testNewFromDefault
	 */
	public function testGetEchoDb( MWEchoDbFactory $db ) {
		$this->assertInstanceOf( IDatabase::class, $db->getEchoDb( DB_MASTER ) );
		$this->assertInstanceOf( IDatabase::class, $db->getEchoDb( DB_REPLICA ) );
	}

	/**
	 * @depends testNewFromDefault
	 */
	public function testGetLB( MWEchoDbFactory $db ) {
		$reflection = new ReflectionClass( 'MWEchoDbFactory' );
		$method = $reflection->getMethod( 'getLB' );
		$method->setAccessible( true );
		$this->assertInstanceOf( ILoadBalancer::class, $method->invoke( $db ) );
	}

{'fraction_non_alphanumeric': 0.14377556984219755, 'fraction_numerical': 0.0, 'mean_word_length': 5.202898550724638, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6421023', 'n_tokens_mistral': 632, 'n_tokens_neox': 593, 'n_words': 110}