<commit_before><?php
namespace DataSource\Tests;

use DataSource\DboSource;

require_once '../../autoload.php';

class DboSourceTest extends \PHPUnit_Framework_TestCase {

	protected static $_dataSource = array(
		'username' => 'hr',
		'password' => '<PASSWORD>',
		'service' => '//localhost:1521',
		'persistent' => true
	);

	/**
	 * @before
	 * @runInSeparateProcess
	 */
	public function testInstanceOf() {
		$dbo = DboSource::connect();
		$this->assertInstanceOf('DataSource\DboSource', $dbo);

		$dbo = new DboSource();
		$this->assertInstanceOf('DataSource\DboSource', $dbo);
	}

	/**
	 * 
	 */
	public function testInstanceOfConnector() {
		$dbo_conn = DboSource::connect(array('connector' => 'oracle'));
		$connector = $dbo_conn->getConnector();
		
		$this->assertInstanceOf('DataSource\Connector\OracleConnector', $connector);

		return $connector;
	}

	/**
	 * @depends testInstanceOfConnector
	 */
	public function testQueryFromSourceGettingConnector(\DataSource\Connector\OracleConnector $connector = null) {
		$query = 'select * from hr.regions where rownum < 10';

		$connector->setDataSource(self::$_dataSource)->openConnection();
		$stid = $connector->query($query);

		$this->assertNotEmpty($stid);<commit_msg>Modified query of example<commit_after><?php
namespace DataSource\Tests;

use DataSource\DboSource;

require_once '../../autoload.php';

class DboSourceTest extends \PHPUnit_Framework_TestCase {

	protected static $_dataSource = array(
		'username' => 'hr',
		'password' => '<PASSWORD>',
		'service' => '//localhost:1521',
		'persistent' => true
	);

	/**
	 * @before
	 * @runInSeparateProcess
	 */
	public function testInstanceOf() {
		$dbo = DboSource::connect();
		$this->assertInstanceOf('DataSource\DboSource', $dbo);

		$dbo = new DboSource();
		$this->assertInstanceOf('DataSource\DboSource', $dbo);
	}

	/**
	 * 
	 */
	public function testInstanceOfConnector() {
		$dbo_conn = DboSource::connect(array('connector' => 'oracle'));
		$connector = $dbo_conn->getConnector();
		
		$this->assertInstanceOf('DataSource\Connector\OracleConnector', $connector);

		return $connector;
	}

	/**
	 * @depends testInstanceOfConnector
	 */
	public function testQueryFromSourceGettingConnector(\DataSource\Connector\OracleConnector $connector = null) {
		$query = 'select * from dual';

		$connector->setDataSource(self::$_dataSource)->openConnection();
		$stid = $connector->query($query);

		$this->assertNotEmpty($stid);
{'fraction_non_alphanumeric': 0.16448445171849427, 'fraction_numerical': 0.004091653027823241, 'mean_word_length': 5.037037037037037, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 31, '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': '3063936', 'n_tokens_mistral': 834, 'n_tokens_neox': 773, 'n_words': 133}