Skip to content

Commit

Permalink
Merge pull request #1398 from keboola/ct-1728-move-delete-tags
Browse files Browse the repository at this point in the history
test remove tag with `/` in name
  • Loading branch information
romanbracinik committed Sep 24, 2024
2 parents 1034dee + 5ac1258 commit 06af3ac
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/File/CommonFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -406,24 +406,24 @@ public function testUploadAndDownloadSlicedFile(): void
public function testTagging(): void
{
$filePath = __DIR__ . '/../_data/files.upload.txt';
$initialTags = ['gooddata', 'image'];
$initialTags = ['gooddata', 'image/tag/tag1/'];
$fileId = $this->_testClient->uploadFile($filePath, (new FileUploadOptions())->setFederationToken(true)->setTags($initialTags));

$file = $this->_testClient->getFile($fileId);
$this->assertEquals($initialTags, $file['tags']);

$this->_testClient->deleteFileTag($fileId, 'gooddata');
$this->_testClient->deleteFileTag($fileId, 'image/tag/tag1/');

$file = $this->_testClient->getFile($fileId);
$this->assertEquals(['image'], $file['tags']);
$this->assertEquals(['gooddata'], $file['tags']);

$this->_testClient->addFileTag($fileId, 'new');
$file = $this->_testClient->getFile($fileId);
$this->assertEquals(['image', 'new'], $file['tags']);
$this->assertEquals(['gooddata', 'new'], $file['tags']);

$this->_testClient->addFileTag($fileId, 'new');
$file = $this->_testClient->getFile($fileId);
$this->assertEquals(['image', 'new'], $file['tags'], 'duplicate tag add is ignored');
$this->assertEquals(['gooddata', 'new'], $file['tags'], 'duplicate tag add is ignored');
}

/** @dataProvider invalidIdDataProvider */
Expand Down

0 comments on commit 06af3ac

Please sign in to comment.