<commit_before><?php

namespace IdeHelper\Test\TestCase\Generator\Task;

use App\Database\Type\UuidType;
use Cake\Database\Type;
use IdeHelper\Generator\Task\DatabaseTypeTask;
use Tools\TestSuite\TestCase;

class DatabaseTypeTaskTest extends TestCase {

	/**
	 * @var \IdeHelper\Generator\Task\DatabaseTypeTask
	 */
	protected $task;

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

		$this->task = new DatabaseTypeTask();
	}

	/**
	 * @return void
	 */
	public function testCollect() {
		Type::map('uuid', UuidType::class);

		$result = $this->task->collect();

		$this->assertCount(1, $result);

		$expected = '\Cake\Database\Type\BinaryType::class';
		$this->assertSame($expected, $result['\Cake\Database\Type::build(0)']['binary']);

		$expected = '\App\Database\Type\UuidType::class';
		$this->assertSame($expected, $result['\Cake\Database\Type::build(0)']['uuid']);
	}

}<commit_msg>Fix tests. map() does not reset the set() call for now (bugfix for master pending).<commit_after><?php

namespace IdeHelper\Test\TestCase\Generator\Task;

use App\Database\Type\UuidType;
use Cake\Database\Type;
use IdeHelper\Generator\Task\DatabaseTypeTask;
use Tools\TestSuite\TestCase;

class DatabaseTypeTaskTest extends TestCase {

	/**
	 * @var \IdeHelper\Generator\Task\DatabaseTypeTask
	 */
	protected $task;

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

		$this->task = new DatabaseTypeTask();
	}

	/**
	 * @return void
	 */
	public function testCollect() {
		Type::set('uuid', new UuidType());

		$result = $this->task->collect();

		$this->assertCount(1, $result);

		$expected = '\Cake\Database\Type\BinaryType::class';
		$this->assertSame($expected, $result['\Cake\Database\Type::build(0)']['binary']);

		$expected = '\App\Database\Type\UuidType::class';
		$this->assertSame($expected, $result['\Cake\Database\Type::build(0)']['uuid']);
	}

}
{'fraction_non_alphanumeric': 0.18430753027909427, 'fraction_numerical': 0.00315955766192733, 'mean_word_length': 4.654761904761905, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '1688722', 'n_tokens_mistral': 666, 'n_tokens_neox': 616, 'n_words': 109}