<commit_before><?php

use Tarantool\Mapper\Client;
use Tarantool\Mapper\Mapper;
use Tarantool\Mapper\Schema;
use Tarantool\Mapper\Plugin\Sequence;
use Tarantool\Client\Request\InsertRequest;

class MapperTest extends TestCase
{
    public function testDoubleCreationTest()
    {
        $mapper = $this->createMapper();
        $mapper->addPlugin(new Sequence($mapper));
        $this->clean($mapper);

        $mapper->getSchema()
            ->createSpace('tester', [
                'id'    => 'unsigned',
                'label' => 'str',
            ])
            ->addIndex('id')
            ->addIndex('label');
<commit_msg>extend identity map test<commit_after><?php

use Tarantool\Mapper\Client;
use Tarantool\Mapper\Mapper;
use Tarantool\Mapper\Schema;
use Tarantool\Mapper\Plugin\Sequence;
use Tarantool\Client\Request\InsertRequest;

class MapperTest extends TestCase
{
    public function testRemoveAndCreate()
    {
        $mapper = $this->createMapper();
        $this->clean($mapper);

        $mapper->getSchema()
            ->createSpace('tester', [
                'a' => 'unsigned',
                'b' => 'unsigned',
            ])
            ->addIndex(['a', 'b']);

        $tester1 = $mapper->create('tester', ['a' => 1, 'b' => 2]);

        $tester1x = $mapper->find('tester', ['a' => 1])[0];
        $this->assertSame($tester1, $tester1x);
        $mapper->remove($tester1x);

        $tester2 = $mapper->create('tester', ['a' => 1, 'b' => 2]);

        $this->assertSame($tester1->a, $tester2->a);
        $this->assertSame($tester1->b, $tester2->b);
        $this->assertNotSame($tester1, $tester2);
    }

    public function testDoubleCreation()
    {
        $mapper = $this->createMapper();
        $mapper->addPlugin(new Sequence($mapper));
        $this->clean($mapper);

        $mapper->getSchema()
            ->createSpace('tester', [
                'id'    => 'unsigned',
                'label' => 'str',
            ])
            ->addIndex('id')
            ->addIndex('label');

{'fraction_non_alphanumeric': 0.17513566847557968, 'fraction_numerical': 0.008880118401578688, 'mean_word_length': 2.297560975609756, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 45, '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': '5791433', 'n_tokens_mistral': 651, 'n_tokens_neox': 631, 'n_words': 104}