Skip to content

Commit

Permalink
Merge pull request #12 from salahhusa9/test
Browse files Browse the repository at this point in the history
Test
  • Loading branch information
salahhusa9 committed Oct 24, 2023
2 parents a07b80e + 41f788c commit fae422e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
7 changes: 0 additions & 7 deletions tests/ExampleTest.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
<?php

use Salahhusa9\Updater\Helpers\Git;

it('can test', function () {

info([
'Git::getCurrentBranch();' => Git::getCurrentBranch(),
]);

expect(true)->toBeTrue();
});
21 changes: 21 additions & 0 deletions tests/HelperTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

use PHPUnit\Framework\TestCase;
use Salahhusa9\Updater\Helpers\Helper;

class HelperTest extends TestCase
{
public function testIsVersionReturnsTrueForValidVersion()
{
$helper = new Helper();

$this->assertEquals($helper->isVersion('v1.2.3'), 1);
}

public function testIsVersionReturnsFalseForInvalidVersion()
{
$helper = new Helper();

$this->assertEqualsCanonicalizing($helper->isVersion('invalid-version'), 0);
}
}

0 comments on commit fae422e

Please sign in to comment.