<commit_before><?php
/**
 *  Ethna_DB_ADOdb_Test.php
 *
 *  @package Ethna
 *  @author <NAME> <<EMAIL>>
 */

//error_reporting(E_ALL);

/**
 *  Ethna_DB_ADOdbクラスのテストケース
 *
 *  @package Ethna
 *  @author <NAME> <<EMAIL>>
 *  @access public
 */
class Ethna_DB_ADOdb_Test extends Ethna_UnitTestBase
{
    /**
     * ADOdb Object
     * @var     Ethna_DB_ADOdb
     * @access  private
     */
    var $db;

    /**
     * database path
     * @var     string
     * @access  private
     */
    var $db_path;

    /**
     * database source name
     * @var     string
     * @access  private
     */
    var $dsn;

    /**
     * database type
     * @var     double
     * @access  public
     */
    var $db_type;

    function setUp()
    {
        //for sqlite
        $this->db_type = 'sqlite';
        $this->db_path = dirname(__FILE__) . "/test.db";
        $this->dsn = "sqlite:///" . $this->db_path;
    }

    function tearDown()
    {
        if ($this->db_type == 'sqlite') {
            if (file_exists($this->db_path)) {
                unlink($this->db_path);
            }
        }
    }

    function testRequire()
    {
        require_once 'Ethna/class/DB/Ethna_DB_ADOdb.php';
    }

    function testMakeInstance()
    {
        if ($this->db_type == 'sqlite') {
            $this->assertTrue(extension_loaded('sqlite'), "this php not installed sqlite");
        }

        $this->db = new Ethna_DB_ADOdb($this->ctl, $this->dsn, false);
        $this->assertTrue(is_object($this->db), "this->db is not object");
        $this->assertEqual(strtolower(get_class($this->db)),
            strtolower("Ethna_DB_ADOdb"), "this->db is not Ethna_DB_ADOdb");
    }

    function testConnect()
    {
        $this->assertTrue($this->db->connect(), "db connect failed");
        $this->assertTrue(file_exists($this->db_path), "db connect failed");
    }

    function testCreateTable()
    {<commit_msg>- supress unlink permission error on windows.<commit_after><?php
/**
 *  Ethna_DB_ADOdb_Test.php
 *
 *  @package Ethna
 *  @author <NAME> <<EMAIL>>
 */

//error_reporting(E_ALL);

/**
 *  Ethna_DB_ADOdbクラスのテストケース
 *
 *  @package Ethna
 *  @author <NAME> <<EMAIL>>
 *  @access public
 */
class Ethna_DB_ADOdb_Test extends Ethna_UnitTestBase
{
    /**
     * ADOdb Object
     * @var     Ethna_DB_ADOdb
     * @access  private
     */
    var $db;

    /**
     * database path
     * @var     string
     * @access  private
     */
    var $db_path;

    /**
     * database source name
     * @var     string
     * @access  private
     */
    var $dsn;

    /**
     * database type
     * @var     double
     * @access  public
     */
    var $db_type;

    function setUp()
    {
        //for sqlite
        $this->db_type = 'sqlite';
        $this->db_path = dirname(__FILE__) . "/test.db";
        $this->dsn = "sqlite:///" . $this->db_path;
    }

    function tearDown()
    {
        if ($this->db_type == 'sqlite') {
            if (file_exists($this->db_path)) {
                @unlink($this->db_path);
            }
        }
    }

    function testRequire()
    {
        require_once 'Ethna/class/DB/Ethna_DB_ADOdb.php';
    }

    function testMakeInstance()
    {
        if ($this->db_type == 'sqlite') {
            $this->assertTrue(extension_loaded('sqlite'), "this php not installed sqlite");
        }

        $this->db = new Ethna_DB_ADOdb($this->ctl, $this->dsn, false);
        $this->assertTrue(is_object($this->db), "this->db is not object");
        $this->assertEqual(strtolower(get_class($this->db)),
            strtolower("Ethna_DB_ADOdb"), "this->db is not Ethna_DB_ADOdb");
    }

    function testConnect()
    {
        $this->assertTrue($this->db->connect(), "db connect failed");
        $this->assertTrue(file_exists($this->db_path), "db connect failed");
    }

    function testCreateTable()
    {
{'fraction_non_alphanumeric': 0.1544251232805606, 'fraction_numerical': 0.0, 'mean_word_length': 2.032258064516129, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 61, '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': '5975004', 'n_tokens_mistral': 1354, 'n_tokens_neox': 1324, 'n_words': 238}