Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/phpunit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:

strategy:
matrix:
php-versions: ['8.2', '${{ needs.matrix.outputs.php-max }}']
php-versions: ['8.3', '${{ needs.matrix.outputs.php-max }}']
server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }}

name: Unit PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ public function testGetChildByUuid(): void {
$this->localService->expects($this->once())
->method('entityList')
->willReturnCallback(function (EventFilter $filter) use ($entity): array {
// the .ics extension is stripped before the uuid lookup
// the full resource name is used for the uuid lookup
$this->assertSame('entity-uuid', $this->conditionValue($filter, 'uuid'));
return [$entity];
});

$child = $this->sut->getChild('entity-uuid.ics');
$child = $this->sut->getChild('entity-uuid');

$this->assertInstanceOf(EventEntity::class, $child);
$this->assertSame('entity-uuid', $child->getName());
Expand All @@ -91,15 +91,15 @@ public function testGetChildFallsBackToRemoteEntityId(): void {
->method('entityList')
->willReturnCallback(function (EventFilter $filter) use ($entity): array {
// uuid lookup yields nothing, ceid lookup resolves the entity by
// the reconstructed full resource path (extension preserved)
// the remote id prefixed with the collection remote id
if ($this->conditionValue($filter, 'uuid') === 'submitted-id') {
return [];
}
$this->assertSame('/remote/Calendar/submitted-id.ics', $this->conditionValue($filter, 'ceid'));
$this->assertSame('/remote/Calendar/submitted-id', $this->conditionValue($filter, 'ceid'));
return [$entity];
});

$child = $this->sut->getChild('submitted-id.ics');
$child = $this->sut->getChild('submitted-id');

$this->assertInstanceOf(EventEntity::class, $child);
$this->assertSame('entity-uuid', $child->getName());
Expand All @@ -123,7 +123,7 @@ public function testChildExistsByUuid(): void {
return [new Entity()];
});

$this->assertTrue($this->sut->childExists('entity-uuid.ics'));
$this->assertTrue($this->sut->childExists('entity-uuid'));
}

public function testChildExistsFallsBackToRemoteEntityId(): void {
Expand All @@ -133,11 +133,11 @@ public function testChildExistsFallsBackToRemoteEntityId(): void {
if ($this->conditionValue($filter, 'uuid') === 'submitted-id') {
return [];
}
$this->assertSame('/remote/Calendar/submitted-id.ics', $this->conditionValue($filter, 'ceid'));
$this->assertSame('/remote/Calendar/submitted-id', $this->conditionValue($filter, 'ceid'));
return [new Entity()];
});

$this->assertTrue($this->sut->childExists('submitted-id.ics'));
$this->assertTrue($this->sut->childExists('submitted-id'));
}

public function testChildExistsReturnsFalseWhenMissing(): void {
Expand Down
Loading