Skip to content

Commit

Permalink
[CI] Add PHP 8.0 to Github actions tests (#4779)
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Dec 5, 2020
1 parent 34881de commit 1e667b4
Show file tree
Hide file tree
Showing 27 changed files with 57 additions and 15 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ jobs:
include:
- php: '7.3'
dependencies: 'lowest'
- php: '8.0'
dependencies: 'latest'


name: PHP ${{ matrix.php }} tests
steps:
Expand All @@ -28,6 +31,9 @@ jobs:
if: "matrix.dependencies == 'lowest'"

- run: composer install --no-progress --ansi
if: "matrix.dependencies != 'lowest'"
if: "matrix.dependencies == 'locked'"

- run: composer install --no-progress --ansi --ignore-platform-req=php
if: "matrix.dependencies == 'latest'"

- run: vendor/bin/phpunit
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ final class InArgChainFluentMethodCallToStandaloneMethodCallRectorTest extends A
{
/**
* @dataProvider provideData()
* @requires PHP < 8.0
*/
public function test(SmartFileInfo $fileInfo): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ public function getNodeTypes(): array
*/
public function refactor(Node $node): ?Node
{
if (! $this->isAtLeastPhpVersion(PhpVersionFeature::CLASS_ON_OBJECT)) {
return null;
}

if (! $this->isName($node->name, 'class')) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
use Symplify\SmartFileSystem\SmartFileInfo;

/**
* @requires PHP >= 8.0
*/
final class DowngradeClassOnObjectToGetClassRectorTest extends AbstractRectorTestCase
{
/**
* @dataProvider provideData()
* @requires PHP >= 8.0
*/
public function test(SmartFileInfo $fileInfo): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
final class DowngradeReturnStaticTypeDeclarationRectorTest extends AbstractRectorTestCase
{
/**
* @requires PHP >= 8.0
* @requires PHP = 8.1
* @dataProvider provideData()
*/
public function test(SmartFileInfo $fileInfo): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Symplify\SmartFileSystem\SmartFileInfo;

/**
* @requires PHP >= 8.0
* @requires PHP 8.1
*/
final class DowngradeUnionTypeParamDeclarationRectorTest extends AbstractRectorTestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Symplify\SmartFileSystem\SmartFileInfo;

/**
* @requires PHP 8.0
* @requires PHP 8.1
*/
final class DowngradeUnionTypeReturnDeclarationRectorTest extends AbstractRectorTestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Symplify\SmartFileSystem\SmartFileInfo;

/**
* @requires PHP >= 8.0
* @requires PHP = 8.1
*/
final class DowngradeUnionTypeTypedPropertyRectorTest extends AbstractRectorTestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
use Symplify\SmartFileSystem\SmartFileInfo;

/**
* @requires PHP = 7.4
*/
final class Php74Test extends AbstractRectorTestCase
{
/**
* @requires PHP 8.0
* @dataProvider provideData()
*/
public function test(SmartFileInfo $fileInfo): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
use Symplify\SmartFileSystem\SmartFileInfo;

/**
* @requires PHP < 8.0
*/
final class RenameVariableToMatchMethodCallReturnTypeRectorTest extends AbstractRectorTestCase
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ final class StaticCallOnNonStaticToInstanceCallRectorTest extends AbstractRector
{
/**
* @dataProvider provideData()
* @requires PHP < 8.0
*/
public function test(SmartFileInfo $fileInfo): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ final class TernaryToNullCoalescingRectorTest extends AbstractRectorTestCase
{
/**
* @dataProvider provideData()
* @requires PHP < 8.0
*/
public function test(SmartFileInfo $fileInfo): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ final class ListEachRectorTest extends AbstractRectorTestCase
{
/**
* @dataProvider provideData()
* @requires PHP < 8.0
*/
public function test(SmartFileInfo $fileInfo): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ final class ReplaceEachAssignmentWithKeyCurrentRectorTest extends AbstractRector
{
/**
* @dataProvider provideData()
* @requires PHP < 8.0
*/
public function test(SmartFileInfo $fileInfo): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ final class BarewordStringRectorTest extends AbstractRectorTestCase
{
/**
* @dataProvider provideData()
* @requires PHP < 8.0
*/
public function test(SmartFileInfo $fileInfo): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ final class CreateFunctionToAnonymousFunctionRectorTest extends AbstractRectorTe
{
/**
* @dataProvider provideData()
* @requires PHP < 8.0
*/
public function test(SmartFileInfo $fileInfo): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
use Symplify\SmartFileSystem\SmartFileInfo;

/**
* @requires PHP < 8.0
*/
final class ParseStrWithResultArgumentRectorTest extends AbstractRectorTestCase
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
use Symplify\SmartFileSystem\SmartFileInfo;

/**
* @requires PHP < 8.0
*/
final class StringifyDefineRectorTest extends AbstractRectorTestCase
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
use Symplify\SmartFileSystem\SmartFileInfo;

/**
* @requires PHP < 8.0
*/
final class StringsAssertNakedRectorTest extends AbstractRectorTestCase
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
use Symplify\SmartFileSystem\SmartFileInfo;

/**
* @requires PHP <= 7.2
*/
final class UnsetCastRectorTest extends AbstractRectorTestCase
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
use Symplify\SmartFileSystem\SmartFileInfo;

/**
* @requires PHP < 8.0
*/
final class WhileEachToForeachRectorTest extends AbstractRectorTestCase
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
use Symplify\SmartFileSystem\SmartFileInfo;

/**
* @requires PHP < 8.0
*/
final class RealToFloatTypeCastRectorTest extends AbstractRectorTestCase
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
use Symplify\SmartFileSystem\SmartFileInfo;

/**
* @requires PHP < 8.0
*/
final class ArrayKeyExistsOnPropertyRectorTest extends AbstractRectorTestCase
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
use Symplify\SmartFileSystem\SmartFileInfo;

/**
* @requires PHP < 8.0
*/
final class FilterVarToAddSlashesRectorTest extends AbstractRectorTestCase
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class MyCustomType extends AbstractType
}
}

class AnotherClass
class AnotherClass extends \DateTime
{
public function setDefaultOptions(SomeResolver $resolver)
{
Expand All @@ -36,7 +36,7 @@ class MyCustomType extends AbstractType
}
}

class AnotherClass
class AnotherClass extends \DateTime
{
public function setDefaultOptions(SomeResolver $resolver)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
use Symplify\SmartFileSystem\SmartFileInfo;

/**
* @requires PHP < 8.0
*/
final class ParseFileRectorTest extends AbstractRectorTestCase
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
use Rector\TypeDeclaration\Rector\Property\CompleteVarDocTypePropertyRector;
use Symplify\SmartFileSystem\SmartFileInfo;

/**
* @requires PHP < 8.0
*/
final class CompleteVarDocTypePropertyRectorTest extends AbstractRectorTestCase
{
/**
Expand Down

0 comments on commit 1e667b4

Please sign in to comment.