<commit_before><?php

namespace Ibonly\SugarORM\Test;

use PDO;
use Mockery;
use Ibonly\SugarORM\Schema;

class SchemaTest extends \PHPUnit_Framework_TestCase
{
    public function setUp()
    {
        $this->schema = new Schema();
    }
    public function testIncrements()
    {
        $this->assertContains('AUTO_INCREMENT', $this->schema->increments('id'));
    }
    public function testStrings()
    {
        $this->assertContains('varchar', $this->schema->strings('name', 20));
    }
    public function testText()
    {
        $this->assertContains('text', $this->schema->text('id'));
    }
    public function testInteger()
    {
        $this->assertContains('int', $this->schema->integer('age', 5));
    }
    public function testPrimaryKey()
    {
        $this->assertContains('KEY', $this->schema->primaryKey('id'));
    }
    public function testUnique()
    {
        $this->assertContains('UNIQUE', $this->schema->unique('email'));
    }
    public function testForeignKey()
    {
        $this->assertContains('FOREIGN', $this->schema->foreignKey('id', 'user_id'));
    }
    public function testBuildQuery()
    {
        $this->assertInternalType("string", $this->schema->buildQuery('schools'));
    }
    public function testSanitizeQuery()
    {
        $this->assertContains(');', $this->schema->sanitizeQuery('email'));
    }

    public function testCreateTable()
    {
        $dbConnMocked = Mockery::mock('\Ibonly\SugarORM\DBConfig');
        $statement = Mockery::mock('\PDOStatement');

        $dbConnMocked->shouldReceive('query')->with("CREATE TABLE IF NOT EXISTS users( id int(11) NOT NULL AUTO_INCREMENT );")->andReturn($statement);

        $this->setExpectedException('\InvalidArgumentException');
        $this->assertTrue($this->schema->createTable('users', $dbConnMocked));
    }
}<commit_msg>Modify travis test error<commit_after><?php

namespace Ibonly\SugarORM\Test;

use PDO;
use Mockery;
use Ibonly\SugarORM\Schema;

class SchemaTest extends \PHPUnit_Framework_TestCase
{
    public function setUp()
    {
        $this->schema = new Schema();
    }
    public function testIncrements()
    {
        $this->assertContains('AUTO_INCREMENT', $this->schema->increments('id'));
    }
    public function testStrings()
    {
        $this->assertContains('varchar', $this->schema->strings('name', 20));
    }
    public function testText()
    {
        $this->assertContains('text', $this->schema->text('id'));
    }
    public function testInteger()
    {
        $this->assertContains('int', $this->schema->integer('age', 5));
    }
    public function testPrimaryKey()
    {
        $this->assertContains('KEY', $this->schema->primaryKey('id'));
    }
    public function testUnique()
    {
        $this->assertContains('UNIQUE', $this->schema->unique('email'));
    }
    public function testForeignKey()
    {
        $this->assertContains('FOREIGN', $this->schema->foreignKey('id', 'user_id'));
    }
    public function testBuildQuery()
    {
        $this->assertInternalType("string", $this->schema->buildQuery('schools'));
    }
    public function testSanitizeQuery()
    {
        $this->assertContains(');', $this->schema->sanitizeQuery('email'));
    }

    public function testCreateTable()
    {
        $dbConnMocked = Mockery::mock('\Ibonly\SugarORM\DBConfig');
        $statement = Mockery::mock('\PDOStatement');

        $dbConnMocked->shouldReceive('query')->with("CREATE TABLE IF NOT EXISTS users( id int(11) NOT NULL AUTO_INCREMENT );")->andReturn($statement);

        $this->setExpectedException('\BadMethodCallException');
        $this->assertTrue($this->schema->createTable('users', $dbConnMocked));
    }
}
{'fraction_non_alphanumeric': 0.16725495519956557, 'fraction_numerical': 0.0027151778441487917, 'mean_word_length': 3.3857142857142857, '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': '6772724', 'n_tokens_mistral': 1101, 'n_tokens_neox': 1092, 'n_words': 181}