<commit_before><?php

/**
 * Description of TableTest
 *
 * @author mafonso
 */
class TableTest extends \PHPUnit_Framework_TestCase
{
    
    public function providerConnection()
    {
        return array(
            array(
                new \PDO(DB_DSN, DB_USER, DB_PASS, array(
                    \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION
                )),
                new \Arch\Logger(RESOURCE_PATH.'dummy')
            )
        );
    }
    
    /**
     * @expectedException \PDOException
     */
    public function testInvalidConnection()
    {
        $logger = new \Arch\Logger(RESOURCE_PATH.'/dummy');
        new \Arch\Table(null, new \PDO('mysql:'), $logger);
    }

    /**
     * @expectedException \Exception
     * @dataProvider providerConnection
     * @param \PDO $pdo
     * @param \Arch\Logger $logger
     */
    public function testInvalidTable($pdo, $logger)
    {
        $result = new \Arch\Table(null, $pdo, $logger);
        $this->assertInstanceOf('\Arch\Table', $result);
    }
    
    /**<commit_msg>Remove test for PDO connection on Table class. It will be part of App tests.<commit_after><?php

/**
 * Description of TableTest
 *
 * @author mafonso
 */
class TableTest extends \PHPUnit_Framework_TestCase
{
    
    public function providerConnection()
    {
        return array(
            array(
                new \PDO(DB_DSN, DB_USER, DB_PASS, array(
                    \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION
                )),
                new \Arch\Logger(RESOURCE_PATH.'dummy')
            )
        );
    }

    /**
     * @expectedException \Exception
     * @dataProvider providerConnection
     * @param \PDO $pdo
     * @param \Arch\Logger $logger
     */
    public function testInvalidTable($pdo, $logger)
    {
        $result = new \Arch\Table(null, $pdo, $logger);
        $this->assertInstanceOf('\Arch\Table', $result);
    }
    
    /**
{'fraction_non_alphanumeric': 0.12525987525987525, 'fraction_numerical': 0.0, 'mean_word_length': 1.903469079939668, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '1270749', 'n_tokens_mistral': 579, 'n_tokens_neox': 568, 'n_words': 119}