Skip to content

Commit

Permalink
Apply php-cs-fixer changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kingjia90 authored and github-actions[bot] committed Jun 13, 2024
1 parent 5a91072 commit eb47b0c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ public function calculateDelta(Localizedfield|AbstractData|\Pimcore\Model\DataOb
$object instanceof \Pimcore\Model\DataObject\Objectbrick\Data\AbstractData => $object->getObject()->getClassId(),
};


if (null === $classId) {
throw new \Exception('Invalid object type');
}
Expand Down Expand Up @@ -226,9 +225,10 @@ public function calculateDelta(Localizedfield|AbstractData|\Pimcore\Model\DataOb
'newRelations' => $newRelations,
'existingRelations' => $existingRelations,
'updatedRelations' => $updatedRelations,
'removedRelations' => $removedRelations
'removedRelations' => $removedRelations,
];
}

public function save(Localizedfield|AbstractData|\Pimcore\Model\DataObject\Objectbrick\Data\AbstractData|Concrete $object, array $params = []): void
{
if (isset($params['isUntouchable']) && $params['isUntouchable']) {
Expand Down
11 changes: 5 additions & 6 deletions tests/Model/Relations/DeltaCalculationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ protected function createRelationObjects(): void
$object->save();
}
}

protected function setUpTestClasses(): void
{
$this->tester->setupPimcoreClass_RelationTest();
Expand Down Expand Up @@ -124,17 +125,15 @@ public function testDeltaManyToMany(): void
$this->metaOrderCheck([2, 0, 3], $multipleManyToMany);
}


/**
* @param array $expectedValues Pass in the CRUD order, C for new, R for existing, U for updated, D for removed
* @return void
*/
protected function deltaCheck(array $expectedValues, $fd, $object): void
{
$delta = $fd->calculateDelta($object, [
'context'=> [
'containerType'=>'object'
]
'containerType'=>'object',
],
]);

$this->assertCount($expectedValues[0], $delta['newRelations'], 'New relations count');
Expand All @@ -145,8 +144,8 @@ protected function deltaCheck(array $expectedValues, $fd, $object): void

protected function metaOrderCheck(array $expectedValues, array $data): void
{
foreach ($data as $i => $relation){
$this->assertEquals("multiple-some-metadata ". $expectedValues[$i], $relation->getMeta(), 'Metadata order check');
foreach ($data as $i => $relation) {
$this->assertEquals('multiple-some-metadata '. $expectedValues[$i], $relation->getMeta(), 'Metadata order check');
}

}
Expand Down

0 comments on commit eb47b0c

Please sign in to comment.