Skip to content

Commit

Permalink
reorganize unit test case gh-218
Browse files Browse the repository at this point in the history
  • Loading branch information
llaville committed Aug 18, 2020
1 parent 1b0679c commit c3f1349
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 27 deletions.
26 changes: 0 additions & 26 deletions tests/PhpFeaturesIssueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ final class PhpFeaturesIssueTest extends \PHPUnit\Framework\TestCase
private const GH168 = 'gh168.php';
private const GH213 = 'gh213.php';
private const GH215 = 'gh215.php';
private const GH218 = 'gh218.php';
private const GH222 = 'gh222.php';
private const GH228 = 'gh228.php';
private const GH238 = 'gh238.php';
Expand Down Expand Up @@ -195,31 +194,6 @@ public function testFeatureGH215()
);
}

/**
* Regression test for feature GH#218
*
* @link https://github.com/llaville/php-compat-info/issues/218
* "::class" not detected as php 5.5
* @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.class.class
* @group features
* @return void
*/
public function testFeatureGH218()
{
$dataSource = self::$fixtures . self::GH218;
$analysers = ['compatibility'];
$metrics = self::$api->run($dataSource, $analysers);
$versions = $metrics[self::$analyserId]['versions'];
$this->assertEquals(
[
'php.min' => '5.5.0',
'php.max' => '',
'php.all' => '5.5.0',
],
$versions
);
}

/**
* Regression test for feature GH#222
*
Expand Down
32 changes: 31 additions & 1 deletion tests/Sniffs/MagicClassConstantSniffTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

namespace Bartlett\Tests\CompatInfo\Sniffs;

class MagicClassConstantSniffTest extends SniffTestCase
/**
* @link https://github.com/llaville/php-compat-info/issues/218
*/
final class MagicClassConstantSniffTest extends SniffTestCase
{
/**
* {@inheritDoc}
Expand Down Expand Up @@ -36,4 +39,31 @@ public function testFetchingClassNameOnObjects()
$versions['php.max']
);
}

/**
* Regression test for issue #218
*
* @link https://github.com/llaville/php-compat-info/issues/218
* "::class" not detected as php 5.5
* @link https://www.php.net/manual/en/language.oop5.basic.php#language.oop5.basic.class.class
* @group features
* @group regression
* @return void
*/
public function testRegressionGH218()
{
$dataSource = self::$fixtures . 'gh218.php';
$analysers = ['compatibility'];
$metrics = self::$api->run($dataSource, $analysers);
$versions = $metrics[self::$analyserId]['versions'];

$this->assertEquals(
'5.5.0',
$versions['php.min']
);
$this->assertEquals(
'',
$versions['php.max']
);
}
}
File renamed without changes.

0 comments on commit c3f1349

Please sign in to comment.