<commit_before><?php
/* This class is part of the XP framework
 *
 * $Id$ 
 */
 
  uses(
    'rdbms.DriverManager', 
    'util.profiling.unittest.TestCase'
  );

  /**
   * Test rdbms API
   *
   * @purpose  Unit Test
   */
  class DBTest extends TestCase {
    var
      $conn = NULL,
      $dsn  = '';
      
    /**
     * Constructor
     *
     * @access  publuc
     * @param   string name
     * @param   string dsn
     */
    function __construct($name, $dsn) {
      $this->dsn= $dsn;
      parent::__construct($name);
    }
      
    /**
     * Setup function
     *
     * @access  public
     * @throws  rdbms.DriverNotSupportedException
     */
    function setUp() {
      try(); {
        $this->conn= &DriverManager::getConnection($this->dsn);
      } if (catch('DriverNotSupportedException', $e)) {
        return throw($e);
      }
    }
    
    /**
     * Tear down function
     *
     * @access  public
     */
    function tearDown() {
      $this->conn->close();
    }
    
    /**
     * Test database connect
     *
     * @access  public
     */
    function testConnect() {
      $result= $this->conn->connect();
      $this->assertTrue($result);
    }
    
    /**
     * Test database select
     *
     * @access  public
     */
    function testSelect() {
      $r= &$this->conn->query('select %s as version', '$Revision$');
      if ($this->assertSubclass($r, 'rdbms.ResultSet')) {
        $version= $r->next('version');
        $this->assertNotEmpty($version);
        return $version;
      }
    }
  }
?><commit_msg>- Also assert that the string that was selected is the same<commit_after><?php
/* This class is part of the XP framework
 *
 * $Id$ 
 */
 
  uses(
    'rdbms.DriverManager', 
    'util.profiling.unittest.TestCase'
  );

  /**
   * Test rdbms API
   *
   * @purpose  Unit Test
   */
  class DBTest extends TestCase {
    var
      $conn = NULL,
      $dsn  = '';
      
    /**
     * Constructor
     *
     * @access  publuc
     * @param   string name
     * @param   string dsn
     */
    function __construct($name, $dsn) {
      $this->dsn= $dsn;
      parent::__construct($name);
    }
      
    /**
     * Setup function
     *
     * @access  public
     * @throws  rdbms.DriverNotSupportedException
     */
    function setUp() {
      try(); {
        $this->conn= &DriverManager::getConnection($this->dsn);
      } if (catch('DriverNotSupportedException', $e)) {
        return throw($e);
      }
    }
    
    /**
     * Tear down function
     *
     * @access  public
     */
    function tearDown() {
      $this->conn->close();
    }
    
    /**
     * Test database connect
     *
     * @access  public
     */
    function testConnect() {
      $result= $this->conn->connect();
      $this->assertTrue($result);
    }
    
    /**
     * Test database select
     *
     * @access  public
     */
    function testSelect() {
      $r= &$this->conn->query('select %s as version', '$Revision$');
      if ($this->assertSubclass($r, 'rdbms.ResultSet')) {
        $version= $r->next('version');
        $this->assertNotEmpty($version);
        $this->assertEquals($version, '$Revision$');
        return $version;
      }
    }
  }
?>
{'fraction_non_alphanumeric': 0.15497349547864048, 'fraction_numerical': 0.0, 'mean_word_length': 1.779896013864818, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 32, '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': '414009', 'n_tokens_mistral': 1044, 'n_tokens_neox': 1023, 'n_words': 207}