<commit_before><?php
require_once 'tests/schema/tests/AuthorBooks.php';
use Lazy\SchemaSqlBuilder;

class ModelTest extends PHPUnit_Framework_ModelTestCase
{

    public function getModels()
    {
        return array( 
            '\tests\AuthorSchema', 
            '\tests\BookSchema',
            '\tests\AuthorBookSchema',
            '\tests\NameSchema',
        );
    }


    public function testSchemaInterface()
    {
        $author = new \tests\Author;
        ok( $author->getColumnNames() );
        ok( $author->getColumns() );
        // ok( $author->getLabel() );
    }

    public function testCollection()
    {
        $author = new \tests\Author;
        $collection = $author->asCollection();
    }

    public function testSchema()
    {
        $author = new \tests\Author;
        ok( $author->_schema );

        $columnMap = $author->_schema->getColumns();

        ok( isset($columnMap['confirmed']) );
        ok( isset($columnMap['identity']) );
        ok( isset($columnMap['name']) );

        ok( $author::schema_proxy_class );
    }

    /****************************
     * Basic CRUD Test 
     ***************************/
	public function testModel()
	{
        $author = new \tests\Author;
        ok( $author->_schema );

        $a2 = new \tests\Author;
        $ret = $a2->find( array( 'name' => 'A record does not exist.' ) );
        ok( ! $ret->success );
        ok( ! $a2->id );

        $a2->loadOrCreate( array( 'name' => 'Record1' , 'email' => '<EMAIL>' , 'identity' => 'record' ) , 'name' );
        ok( $id = $a2->id );

        $a2->loadOrCreate( array( 'name' => 'Record1' , 'email' => '<EMAIL>' , 'identity' => 'record' ) , 'name' );
        is( $id, $a2->id );<commit_msg>getColumns() method<commit_after><?php
require_once 'tests/schema/tests/AuthorBooks.php';
use Lazy\SchemaSqlBuilder;

class ModelTest extends PHPUnit_Framework_ModelTestCase
{

    public function getModels()
    {
        return array( 
            '\tests\AuthorSchema', 
            '\tests\BookSchema',
            '\tests\AuthorBookSchema',
            '\tests\NameSchema',
        );
    }


    public function testSchemaInterface()
    {
        $author = new \tests\Author;
        ok( $author->getColumnNames() );
        ok( $author->getColumns() );
        // ok( $author->getLabel() );
    }

    public function testCollection()
    {
        $author = new \tests\Author;
        $collection = $author->asCollection();
    }

    public function testSchema()
    {
        $author = new \tests\Author;
        ok( $author->_schema );

        $columnMap = $author->_schema->getColumns();

        ok( isset($columnMap['confirmed']) );
        ok( isset($columnMap['identity']) );
        ok( isset($columnMap['name']) );

        ok( $author::schema_proxy_class );

        $columnMap = $author->getColumns();

        ok( isset($columnMap['identity']) );
    }

    /****************************
     * Basic CRUD Test 
     ***************************/
	public function testModel()
	{
        $author = new \tests\Author;
        ok( $author->_schema );

        $a2 = new \tests\Author;
        $ret = $a2->find( array( 'name' => 'A record does not exist.' ) );
        ok( ! $ret->success );
        ok( ! $a2->id );

        $a2->loadOrCreate( array( 'name' => 'Record1' , 'email' => '<EMAIL>' , 'identity' => 'record' ) , 'name' );
        ok( $id = $a2->id );

        $a2->loadOrCreate( array( 'name' => 'Record1' , 'email' => '<EMAIL>' , 'identity' => 'record' ) , 'name' );
        is( $id, $a2->id );
{'fraction_non_alphanumeric': 0.19983112862369828, 'fraction_numerical': 0.0050661412890515055, 'mean_word_length': 2.2397447584320873, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 52, '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': '86092', 'n_tokens_mistral': 1090, 'n_tokens_neox': 1060, 'n_words': 219}