Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.
This repository was archived by the owner on Feb 7, 2025. It is now read-only.

limit argument not worked in batch list and read model #389

@mesilov

Description

@mesilov
        $greaterThanDefaultPageSize = 120;
        $originatorId = Uuid::v7()->toRfc4122();
        // add test contacts
        $contacts = [];
        for ($i = 0; $i < $greaterThanDefaultPageSize; $i++) {
            $contacts[] = [
                'fields' => [
                    'NAME' => 'name-' . $i,
                    'ORIGINATOR_ID' => $originatorId
                ]
            ];
        }
        $cnt = 0;
        foreach ($this->batch->addEntityItems('crm.contact.add', $contacts) as $addedContactResult) {
            $cnt++;
        }
        $this->assertEquals(count($contacts), $cnt);
        $this->assertEquals(count($contacts), $this->serviceBuilder->getCRMScope()->contact()->countByFilter([
            'ORIGINATOR_ID' => $originatorId
        ]));

        // test batch with limit
        foreach ($this->batch->getTraversableList('crm.contact.list',
            [],
            [
                'ORIGINATOR_ID' => $originatorId
            ],
            [
                'ID',
                'NAME',
                'ORIGINATOR_ID'
            ],
            $greaterThanDefaultPageSize / 2
        ) as $cnt => $itemContact) {
            $readResultId[] = $itemContact['ID'];
        }
        $this->assertCount($greaterThanDefaultPageSize / 2, $readResultId);

Metadata

Metadata

Assignees

Labels

2.xissue related with 2.x sdk versionbug⏳ WIPwork in progress💠 core💰 sponsoredзадача оплачена

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions