Skip to content

Commit

Permalink
Add tests for getting a template with a given version
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromegamez committed May 15, 2024
1 parent 0804e20 commit 71ea15b
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tests/Integration/RemoteConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,42 @@ public function forcePublishAndGet(): void
$this->assertSame(UpdateOrigin::REST_API, (string) $version?->updateOrigin());
}

#[Test]
public function getTemplateWithVersion(): void
{
$template = $this->remoteConfig->get();
$version = $template->version();
assert($version !== null);

$check = $this->remoteConfig->get($version);

$this->assertTrue($version->versionNumber()->equalsTo($check->version()?->versionNumber()));
}

#[Test]
public function getTemplateWithVersionNumber(): void
{
$template = $this->remoteConfig->get();
$version = $template->version();
assert($version !== null);

$check = $this->remoteConfig->get($version->versionNumber());

$this->assertTrue($version->versionNumber()->equalsTo($check->version()?->versionNumber()));
}

#[Test]
public function getTemplateWithVersionNumberString(): void
{
$template = $this->remoteConfig->get();
$version = $template->version();
assert($version !== null);

$check = $this->remoteConfig->get((string) $version->versionNumber());

$this->assertTrue($version->versionNumber()->equalsTo($check->version()?->versionNumber()));
}

#[Test]
public function publishOutdatedConfig(): void
{
Expand Down

0 comments on commit 71ea15b

Please sign in to comment.