<commit_before><?php namespace Orchestra\Widget\Tests;

class DriverTest extends \PHPUnit_Framework_TestCase {
	
	/**
	 * Setup the test environment.
	 */
	public function setUp()
	{
		$appMock = \Mockery::mock('Application')
			->shouldReceive('instance')->andReturn(true);

		\Illuminate\Support\Facades\Config::setFacadeApplication($appMock->getMock());
	}

	/**
	 * Teardown the test environment.
	 */
	public function tearDown()
	{
		\Mockery::close();
	}

	/**
	 * Test construct a Orchestra\Widget\Driver
	 *
	 * @test
	 */
	public function testConstructMethod()
	{
		$configMock = \Mockery::mock('Config')
			->shouldReceive('get')
			->once()
			->andReturn(array());

		\Illuminate\Support\Facades\Config::swap($configMock->getMock());
		$stub = new DriverStub('foo', array());

		$refl   = new \ReflectionObject($stub);
		$config = $refl->getProperty('config');
		$name   = $refl->getProperty('name');
		$nesty  = $refl->getProperty('nesty');
		$type   = $refl->getProperty('type');

		$config->setAccessible(true);
		$name->setAccessible(true);
		$nesty->setAccessible(true);
		$type->setAccessible(true);

		$this->assertEquals(array(), 
			$config->getValue($stub));
		$this->assertEquals('foo', $name->getValue($stub));
		$this->assertInstanceOf('\Orchestra\Widget\Nesty', $nesty->getValue($stub));
		$this->assertEquals('stub', $type->getValue($stub));
	}

	/**
	 * Test Orchestra\Widget\Driver::getItem() method.
	 *
	 * @test
	 */
	public function testGetItemMethod()
	{
		$configMock = \Mockery::mock('Config')
			->shouldReceive('get')
			->once()
			->andReturn(array());

		\Illuminate\Support\Facades\Config::swap($configMock->getMock());
		$stub = new DriverStub('foo', array());

		$this->assertEquals(array(), $stub->getItem());
		$this->assertEquals(array(), $stub->items);
	}

	/**
	 * Test Orchestra\Widget\Driver::__get() throws an exception.
	 *
	 * @expectedException \InvalidArgumentException
	 */
	public function testMagicMethodGetThrowsException()
	{
		$configMock = \Mockery::mock('Config')
			->shouldReceive('get')
			->once()
			->andReturn(array());

		\Illuminate\Support\Facades\Config::swap($configMock->getMock());
		$stub = new DriverStub('foo', array());
<commit_msg>Add whitespace<commit_after><?php namespace Orchestra\Widget\Tests;

class DriverTest extends \PHPUnit_Framework_TestCase {
	
	/**
	 * Setup the test environment.
	 */
	public function setUp()
	{
		$appMock = \Mockery::mock('Application')
			->shouldReceive('instance')->andReturn(true);

		\Illuminate\Support\Facades\Config::setFacadeApplication($appMock->getMock());
	}

	/**
	 * Teardown the test environment.
	 */
	public function tearDown()
	{
		\Mockery::close();
	}

	/**
	 * Test construct a Orchestra\Widget\Driver
	 *
	 * @test
	 */
	public function testConstructMethod()
	{
		$configMock = \Mockery::mock('Config')
			->shouldReceive('get')
			->once()
			->andReturn(array());

		\Illuminate\Support\Facades\Config::swap($configMock->getMock());
		
		$stub = new DriverStub('foo', array());

		$refl   = new \ReflectionObject($stub);
		$config = $refl->getProperty('config');
		$name   = $refl->getProperty('name');
		$nesty  = $refl->getProperty('nesty');
		$type   = $refl->getProperty('type');

		$config->setAccessible(true);
		$name->setAccessible(true);
		$nesty->setAccessible(true);
		$type->setAccessible(true);

		$this->assertEquals(array(), 
			$config->getValue($stub));
		$this->assertEquals('foo', $name->getValue($stub));
		$this->assertInstanceOf('\Orchestra\Widget\Nesty', $nesty->getValue($stub));
		$this->assertEquals('stub', $type->getValue($stub));
	}

	/**
	 * Test Orchestra\Widget\Driver::getItem() method.
	 *
	 * @test
	 */
	public function testGetItemMethod()
	{
		$configMock = \Mockery::mock('Config')
			->shouldReceive('get')
			->once()
			->andReturn(array());

		\Illuminate\Support\Facades\Config::swap($configMock->getMock());

		$stub = new DriverStub('foo', array());

		$this->assertEquals(array(), $stub->getItem());
		$this->assertEquals(array(), $stub->items);
	}

	/**
	 * Test Orchestra\Widget\Driver::__get() throws an exception.
	 *
	 * @expectedException \InvalidArgumentException
	 */
	public function testMagicMethodGetThrowsException()
	{
		$configMock = \Mockery::mock('Config')
			->shouldReceive('get')
			->once()
			->andReturn(array());

		\Illuminate\Support\Facades\Config::swap($configMock->getMock());

		$stub = new DriverStub('foo', array());

{'fraction_non_alphanumeric': 0.19711321605773569, 'fraction_numerical': 0.0, 'mean_word_length': 4.550688360450563, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 73, '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': '5659886', 'n_tokens_mistral': 1548, 'n_tokens_neox': 1426, 'n_words': 217}