<commit_before><?php

class DinklyDataConfigTest extends PHPUnit_Framework_TestCase
{
		protected $db;

	protected function setUp()
	{
		date_default_timezone_set("Europe/Paris");


	}

	public function testLoadDBCreds()
	{
		 // $this->assertTrue(true);
		$creds=DinklyDataConfig::getDBCreds();
	}
	

}
?>
<!-- php vendor/phpunit/phpunit/phpunit --bootstrap config/bootstrap.php tools/unit_tests/classes/core/DinklyDataConfig.php --><commit_msg>added more tests for DinklyDataConfig<commit_after><?php
use Symfony\Component\Yaml\Yaml;
class DinklyDataConfigTest extends PHPUnit_Framework_TestCase
{
		protected $db;

	protected function setUp()
	{
		date_default_timezone_set("Europe/Paris");


	}

	public function testGetDBCreds()
	{
		//make sure the yaml is parsing correctly
		$db_creds = Yaml::parse($_SERVER['APPLICATION_ROOT'] . "config/db.yml");
		$creds = DinklyDataConfig::getDBCreds(); 
		$this->assertEquals($db_creds['admin'],$creds);
		
	}
	public function testHasConnection(){

				//test on connection that does not exist
				$this->assertFalse(DinklyDataConfig::hasConnection('admin_table'));

				//test create connection and then see if exists
				DinklyDataConfig::loadDBCreds();
				$this->assertTrue(DinklyDataConfig::hasConnection('admin'));


	}
		public function testSetActiveConnection(){

		  $db_creds = Yaml::parse($_SERVER['APPLICATION_ROOT'] . "config/db.yml");  
			$_SESSION['dinkly']['db_creds'] = $db_creds; 
			$set_db=DinklyDataConfig::setActiveConnection('admin');
			$this->assertTrue($set_db);
			//make sure connection was actually made
			$this->assertTrue(DinklyDataConfig::hasConnection('admin'));

	}
		public function testLoadDBCreds(){

			$db_creds= DinklyDataConfig::getDBCreds(); 
			$first_connection = key($db_creds);
		



	}

}
?>
<!-- php vendor/phpunit/phpunit/phpunit --bootstrap config/bootstrap.php tools/unit_tests/classes/core/DinklyDataConfig.php -->
{'fraction_non_alphanumeric': 0.13740856844305122, 'fraction_numerical': 0.0, 'mean_word_length': 5.157556270096463, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, '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': '5520863', 'n_tokens_mistral': 692, 'n_tokens_neox': 625, 'n_words': 104}