v1.0.0
This commit is contained in:
parent
0fcf42b47b
commit
443dceb8ca
1 changed files with 566609 additions and 230 deletions
35
vendor/eduardovillao/wp-since/tests/VersionResolverTest.php
vendored
Normal file
35
vendor/eduardovillao/wp-since/tests/VersionResolverTest.php
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
namespace WP_Since\Tests;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use WP_Since\Resolver\VersionResolver;
|
||||
|
||||
class VersionResolverTest extends TestCase
|
||||
{
|
||||
public function testExtractsVersionFromMainPluginFile()
|
||||
{
|
||||
$path = __DIR__ . '/fixtures/plugin-with-header';
|
||||
$resolved = VersionResolver::resolve($path);
|
||||
|
||||
$this->assertEquals('6.2', $resolved['version']);
|
||||
$this->assertEquals('main plugin file header', $resolved['source']);
|
||||
}
|
||||
|
||||
public function testExtractsVersionFromReadmeIfNoHeader()
|
||||
{
|
||||
$path = __DIR__ . '/fixtures/plugin-with-readme-only';
|
||||
$resolved = VersionResolver::resolve($path);
|
||||
|
||||
$this->assertEquals('5.8', $resolved['version']);
|
||||
$this->assertEquals('readme', $resolved['source']);
|
||||
}
|
||||
|
||||
public function testReturnsNullIfVersionNotFoundAnywhere()
|
||||
{
|
||||
$path = __DIR__ . '/fixtures/plugin-without-version';
|
||||
$resolved = VersionResolver::resolve($path);
|
||||
|
||||
$this->assertNull($resolved);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue