Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
kvz committed Nov 26, 2024
1 parent 1c826e3 commit db193ab
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/SmartCDNNodeParityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,4 +265,28 @@ public function testEmptyStringInput(): void {

$this->assertEquals($nodeUrl, $url, 'Empty string input should be handled the same as node');
}

public function testEmptyParamString(): void {
$params = [
'workspace' => $this->workspace,
'template' => $this->template,
'input' => 'test.jpg',
'expire_at_ms' => $this->expireAt,
'url_params' => [
'width' => '',
'height' => '200'
]
];

$url = $this->transloadit->signedSmartCDNUrl(
$params['workspace'],
$params['template'],
$params['input'],
$params['url_params'],
['expireAtMs' => $params['expire_at_ms']]
);
$nodeUrl = $this->runNodeScript($params);

$this->assertEquals($nodeUrl, $url, 'Empty parameter string should be handled the same as node');
}
}
5 changes: 5 additions & 0 deletions test/simple/TransloaditTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ public function testSignedSmartCDNUrl() {
$url = $transloadit->signedSmartCDNUrl('workspace', 'template', 'file.jpg', ['width' => 100]);
$this->assertStringContainsString('width=100', $url);

// Test with empty param string
$url = $transloadit->signedSmartCDNUrl('workspace', 'template', 'file.jpg', ['width' => '', 'height' => '200']);
$this->assertStringNotContainsString('width=', $url, 'Empty parameter should be excluded from URL');
$this->assertStringContainsString('height=200', $url);

// Test with custom sign props
$url = $transloadit->signedSmartCDNUrl(
'workspace',
Expand Down

0 comments on commit db193ab

Please sign in to comment.