forked from rectorphp/rector
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pick system-level testing from rectorphp#5784
- Loading branch information
Showing
11 changed files
with
153 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: System Tests | ||
|
||
on: ['push'] | ||
|
||
jobs: | ||
system_tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: [ '7.4', '8.0' ] | ||
|
||
name: PHP ${{ matrix.php }} system tests | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
coverage: none # disable xdebug, pcov | ||
|
||
- name: Install dependencies for Rector | ||
run: composer install --no-progress --ansi | ||
|
||
# This workflow runs system tests: Use the Rector application from the source | ||
# checkout to process "fixture" projects in tests/system-tests | ||
# to see if those can be processed successfully | ||
|
||
- name: Generate Composer autoloaders in fixture directories | ||
run: | | ||
for FIXTURE in `find tests/system-tests -mindepth 1 -maxdepth 1 -type d`; do | ||
(cd $FIXTURE; composer install --no-progress --ansi) | ||
done | ||
- name: Run system tests | ||
run: | | ||
HAS_FAILURES=0 | ||
for FIXTURE in `find tests/system-tests -mindepth 1 -maxdepth 1 -type d`; do | ||
echo "-----> Running $FIXTURE <-----" | ||
if (cd $FIXTURE; ../../../bin/rector process --dry-run --clear-cache); then | ||
echo "-----> Result: OK <-----" | ||
else | ||
echo "-----> Result: FAILED <-----" | ||
HAS_FAILURES=1 | ||
fi | ||
done | ||
exit $HAS_FAILURES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"autoload": { | ||
"psr-4": { | ||
"Symfony\\Component\\Console\\Output\\": "src" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Rector\Core\Configuration\Option; | ||
use Rector\Php74\Rector\Property\TypedPropertyRector; | ||
use Rector\Set\ValueObject\SetList; | ||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; | ||
|
||
return static function (ContainerConfigurator $containerConfigurator): void { | ||
$parameters = $containerConfigurator->parameters(); | ||
$parameters->set(Option::PATHS, [__DIR__.'/src']); | ||
$parameters->set(Option::SKIP, [__DIR__.'/vendor']); | ||
|
||
$parameters->set(Option::SETS, [SetList::PHP_53]); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
namespace Symfony\Component\Console\Output; | ||
|
||
use Exception; | ||
|
||
throw new Exception('Running code from ' . __FILE__); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"autoload": { | ||
"psr-4": { | ||
"Foo\\": "src" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Rector\Core\Configuration\Option; | ||
use Rector\Php74\Rector\Property\TypedPropertyRector; | ||
use Rector\Set\ValueObject\SetList; | ||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; | ||
|
||
return static function (ContainerConfigurator $containerConfigurator): void { | ||
$parameters = $containerConfigurator->parameters(); | ||
$parameters->set(Option::PATHS, [__DIR__.'/src']); | ||
$parameters->set(Option::SKIP, [__DIR__.'/vendor']); | ||
|
||
$parameters->set(Option::SETS, [SetList::PHP_53]); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
namespace Foo; | ||
|
||
class Foo | ||
{ | ||
public function __construct() | ||
{ | ||
$bar = 'baz'; | ||
print $bar{2}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"autoload": { | ||
"psr-4": { | ||
"Foo\\": "src" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Rector\Core\Configuration\Option; | ||
use Rector\Php74\Rector\Property\TypedPropertyRector; | ||
use Rector\Set\ValueObject\SetList; | ||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; | ||
|
||
return static function (ContainerConfigurator $containerConfigurator): void { | ||
$parameters = $containerConfigurator->parameters(); | ||
$parameters->set(Option::PATHS, [__DIR__.'/src']); | ||
$parameters->set(Option::SKIP, [__DIR__.'/vendor']); | ||
|
||
$parameters->set(Option::SETS, [SetList::PHP_53]); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Foo; | ||
|
||
class Foo | ||
{ | ||
public function __construct( | ||
public string $property = 'value', | ||
) {} | ||
} |