Skip to content

Commit

Permalink
✅ Okay codecov, so improved the coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
siketyan committed Jan 30, 2021
1 parent 3e1f896 commit d684959
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/Versioning/Unknown/UnknownVersionComparatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Siketyan\Loxcan\Versioning\Unknown;

use PHPUnit\Framework\TestCase;
use Siketyan\Loxcan\Versioning\SemVer\SemVerVersion;
use Siketyan\Loxcan\Versioning\Simple\SimpleVersion;
use Siketyan\Loxcan\Versioning\VersionDiff;
use Siketyan\Loxcan\Versioning\VersionInterface;
Expand Down Expand Up @@ -39,6 +40,25 @@ public function test(): void
);
}

public function testSupports(): void
{
$this->assertTrue(
$this->comparator->supports(UnknownVersion::class, UnknownVersion::class),
);

$this->assertTrue(
$this->comparator->supports(SimpleVersion::class, UnknownVersion::class),
);

$this->assertTrue(
$this->comparator->supports(SemVerVersion::class, SimpleVersion::class),
);

$this->assertFalse(
$this->comparator->supports(UnknownVersion::class, VersionDiff::class),
);
}

private function assertCompare(?int $type, VersionInterface $before, VersionInterface $after): void
{
$diff = $this->comparator->compare($before, $after);
Expand Down
27 changes: 27 additions & 0 deletions tests/Versioning/Unknown/UnknownVersionTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

declare(strict_types=1);

namespace Siketyan\Loxcan\Versioning\Unknown;

use PHPUnit\Framework\TestCase;

class UnknownVersionTest extends TestCase
{
private const VERSION = '1.2.3.4';

private UnknownVersion $version;

protected function setUp(): void
{
$this->version = new UnknownVersion(self::VERSION);
}

public function testToString(): void
{
$this->assertSame(
self::VERSION,
$this->version->__toString(),
);
}
}

0 comments on commit d684959

Please sign in to comment.