<commit_before><?php
namespace CsvMigrations\Test\TestCase;

use Cake\Core\Configure;
use Cake\ORM\TableRegistry;
use Cake\TestSuite\TestCase;
use CsvMigrations\FieldTrait;

class FieldTraitTest extends TestCase
{
    /**
     * FooTable instance
     *
     * @var CsvMigrations\Test\TestCase\Model\Table\FooTable
     */
    public $FooTable;

    /**
     * setUp method
     *
     * @return void
     */
    public function setUp()
    {
        parent::setUp();

        $dir = dirname(__DIR__) . DS . '..' . DS . '..' . DS . 'data' . DS . 'CsvMigrations' . DS;

        /*
        point to test data
         */
        Configure::write('CsvMigrations.migrations.path', $dir . 'migrations' . DS);
        Configure::write('CsvMigrations.lists.path', $dir . 'lists' . DS);
        Configure::write('CsvMigrations.migrations.filename', 'migration.dist');
        $config = TableRegistry::exists('Foo') ? [] : ['className' => 'CsvMigrations\Test\TestCase\Model\Table\FooTable'];
        $this->FooTable = TableRegistry::get('Foo', $config);
        $this->mock = $this->getMockForTrait(FieldTrait::class);
    }

    public function testGetUniqueFields()
    {
        $this->assertEquals(['name', 'id'], $this->mock->getUniqueFields($this->FooTable));
    }
}<commit_msg>sort array before assertion<commit_after><?php
namespace CsvMigrations\Test\TestCase;

use Cake\Core\Configure;
use Cake\ORM\TableRegistry;
use Cake\TestSuite\TestCase;
use CsvMigrations\FieldTrait;

class FieldTraitTest extends TestCase
{
    /**
     * FooTable instance
     *
     * @var CsvMigrations\Test\TestCase\Model\Table\FooTable
     */
    public $FooTable;

    /**
     * setUp method
     *
     * @return void
     */
    public function setUp()
    {
        parent::setUp();

        $dir = dirname(__DIR__) . DS . '..' . DS . '..' . DS . 'data' . DS . 'CsvMigrations' . DS;

        /*
        point to test data
         */
        Configure::write('CsvMigrations.migrations.path', $dir . 'migrations' . DS);
        Configure::write('CsvMigrations.lists.path', $dir . 'lists' . DS);
        Configure::write('CsvMigrations.migrations.filename', 'migration.dist');
        $config = TableRegistry::exists('Foo') ? [] : ['className' => 'CsvMigrations\Test\TestCase\Model\Table\FooTable'];
        $this->FooTable = TableRegistry::get('Foo', $config);
        $this->mock = $this->getMockForTrait(FieldTrait::class);
    }

    public function testGetUniqueFields()
    {
        $uniqueFields = $this->mock->getUniqueFields($this->FooTable);
        sort($uniqueFields);
        $this->assertEquals(['id', 'name'], $uniqueFields);
    }
}
{'fraction_non_alphanumeric': 0.16021260440394836, 'fraction_numerical': 0.0, 'mean_word_length': 2.7217514124293785, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '1988392', 'n_tokens_mistral': 868, 'n_tokens_neox': 843, 'n_words': 140}