<commit_before><?php

namespace li3_freshbooks\tests\cases\models;

use \li3_freshbooks\models\Invoices;

class InvoicesTest extends \lithium\test\Unit {

	public function testWhetherDbQueryWorks() {
	    $id = Invoices::find('first')->id;
	    $this->assertTrue(!empty($id), 'Query did not pull data');
	}
}

?><commit_msg>Using mock in Invoice test; renaming test method.<commit_after><?php

namespace li3_freshbooks\tests\cases\models;

use lithium\data\Connections;
use li3_freshbooks\extensions\adapter\data\source\http\Freshbooks;
use li3_freshbooks\models\Invoices;

class InvoicesTest extends \lithium\test\Unit {

	public $source;

	protected $_backup = array();

	protected $_testConfig = array(
		'login' => 'test',
		'password' => '<PASSWORD>',
		'socket' => 'li3_freshbooks\tests\mocks\data\source\http\MockFreshbooksSocket'
	);

	public function setUp() {
		$this->_backup['connections'] = Connections::config();

		Connections::reset();
		$this->source = new Freshbooks(array('socket' => false));

		Connections::config(array(
			'freshbooks' => array(
				'object' => &$this->source,
				'adapter' => 'Freshbooks'
			)
		));
	}

	public function tearDown() {
		Connections::reset();
		Connections::config($this->_backup['connections']);
	}

	public function testFind() {
	    $result = Invoices::find('first')->id;
	    $this->assertTrue($id, 'Query did not pull data.');
	}
}

?>
{'fraction_non_alphanumeric': 0.16404011461318052, 'fraction_numerical': 0.004297994269340974, 'mean_word_length': 4.820833333333334, 'pattern_counts': {'":': 0, '<': 6, '<?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': '5268723', 'n_tokens_mistral': 504, 'n_tokens_neox': 458, 'n_words': 87}