VersionCommitCollection example


    protected $name;

    /** * @var VersionCommitCollection */
    protected $commits;

    public function __construct()
    {
        $this->commits = new VersionCommitCollection();
    }

    public function getCommits(): VersionCommitCollection
    {
        return $this->commits;
    }

    public function setCommits(VersionCommitCollection $commits): void
    {
        $this->commits = $commits;
    }

    
$lockFactory->expects(static::once())->method('createLock')->willReturn($lock);

        $versionCommit = new VersionCommitEntity();
        $versionCommitData = new VersionCommitDataEntity();
        $versionCommitData->setAction('insert');
        $versionCommitData->setId(Uuid::randomHex());
        $versionCommitData->setEntityName('product');
        $versionCommitData->setEntityId([Uuid::randomHex()]);
        $versionCommit->setData(new VersionCommitDataCollection([$versionCommitData]));
        $versionCommit->setId(Uuid::randomHex());

        $entityReaderMock->expects(static::once())->method('read')->willReturn(new VersionCommitCollection([$versionCommit]));

        $writeContextMock = $this->createMock(WriteContext::class);

        $this->versionManager->merge(
            Uuid::randomHex(),
            $writeContextMock
        );
    }

    public function testMergeEntityWithUpsertVersionCommitAction(): void
    {
        
Home | Imprint | This part of the site doesn't use cookies.