mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-18 17:12:22 +00:00
[e2e][scoped] Add e2e global install on scoped (#1704)
* [e2e][scoped] Add e2e global install on scoped * rector command to reproduce * clean up comment * wait 70 seconds for deploy to packagist * autoload * clean up * clean up * clean up
This commit is contained in:
parent
9b62f0a4c7
commit
672b339ebd
40
build/target-repository/.github/workflows/e2e_global.yaml
vendored
Normal file
40
build/target-repository/.github/workflows/e2e_global.yaml
vendored
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
name: End to End global tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request: null
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
end_to_end:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
php_version: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
|
||||||
|
directory:
|
||||||
|
- 'e2e/global-install'
|
||||||
|
|
||||||
|
name: End to end test - ${{ matrix.directory }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php_version }}
|
||||||
|
coverage: none
|
||||||
|
|
||||||
|
# wait for deploy to packagist
|
||||||
|
- run: sleep 70
|
||||||
|
|
||||||
|
-
|
||||||
|
run: |
|
||||||
|
composer global require --dev rector/rector:dev-main
|
||||||
|
composer install --ansi
|
||||||
|
working-directory: ${{ matrix.directory }}
|
||||||
|
|
||||||
|
-
|
||||||
|
run: rector process --ansi --clear-cache
|
||||||
|
working-directory: ${{ matrix.directory }}
|
1
build/target-repository/e2e/global-install/.gitignore
vendored
Normal file
1
build/target-repository/e2e/global-install/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
/vendor
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
|
interface ExceptionInterface
|
||||||
|
{
|
||||||
|
}
|
8
build/target-repository/e2e/global-install/composer.json
Normal file
8
build/target-repository/e2e/global-install/composer.json
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"App\\": "App",
|
||||||
|
"GlobalInstall\\": "src"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
15
build/target-repository/e2e/global-install/rector.php
Normal file
15
build/target-repository/e2e/global-install/rector.php
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
use Rector\CodingStyle\Rector\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector;
|
||||||
|
use Rector\Core\Configuration\Option;
|
||||||
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||||
|
|
||||||
|
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||||
|
$parameters = $containerConfigurator->parameters();
|
||||||
|
$parameters->set(Option::PATHS, [__DIR__ . '/src/']);
|
||||||
|
|
||||||
|
$services = $containerConfigurator->services();
|
||||||
|
$services->set(MakeInheritedMethodVisibilitySameAsParentRector::class);
|
||||||
|
};
|
|
@ -0,0 +1,13 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace GlobalInstall;
|
||||||
|
|
||||||
|
use App\ExceptionInterface;
|
||||||
|
|
||||||
|
class MyException extends \RuntimeException implements ExceptionInterface
|
||||||
|
{
|
||||||
|
public static function forAnything(string $content)
|
||||||
|
{
|
||||||
|
return new static($content);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user