-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from kurozumi/fix-auth0-extension
fix Auth0Extension
- Loading branch information
Showing
5 changed files
with
70 additions
and
159 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,56 +1,47 @@ | ||
name: PHPStan | ||
on: [workflow_dispatch, pull_request] | ||
|
||
env: | ||
PLUGIN_CODE: Auth0 | ||
PLUGIN_BRANCH: '4.2' | ||
PLUGIN_PACKAGE_NAME: 'ec-cube/auth0' | ||
|
||
jobs: | ||
phpstan: | ||
name: PHPStan | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
eccube-versions: ['4.2', '4.3'] | ||
php-versions: [ '7.4', '8.0', '8.1', '8.2', '8.3' ] | ||
exclude: | ||
- eccube-versions: 4.2 | ||
php-versions: 8.2 | ||
- eccube-versions: 4.2 | ||
php-versions: 8.3 | ||
- eccube-versions: 4.3 | ||
php-versions: 7.4 | ||
- eccube-versions: 4.3 | ||
php-versions: 8.0 | ||
eccube-versions: [ '4.2', '4.3' ] | ||
php-versions: [ '8.1' ] | ||
database: [ 'mysql8' ] | ||
include: | ||
- database: mysql8 | ||
database_url: mysql://root:password@127.0.0.1:3308/eccube_db | ||
database_server_version: 8 | ||
database_charset: utf8mb4 | ||
services: | ||
mysql8: | ||
image: mysql:8 | ||
env: | ||
MYSQL_ROOT_PASSWORD: password | ||
ports: | ||
- 3308:3306 | ||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | ||
|
||
steps: | ||
- name: Checkout EC-CUBE | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: EC-CUBE/ec-cube | ||
ref: ${{ matrix.eccube-versions }} | ||
|
||
- name: Setup PHP, with composer and extensions | ||
uses: shivammathur/setup-php@master #https://github.com/shivammathur/setup-php | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
extensions: mbstring, xml, ctype, iconv, mysql, intl, :xdebug | ||
tools: composer:v2 | ||
|
||
- name: composer install | ||
run: | | ||
composer install --dev --no-interaction -o --apcu-autoloader | ||
composer config --no-plugins allow-plugins.php-http/discovery false | ||
composer require knpuniversity/oauth2-client-bundle | ||
composer require riskio/oauth2-auth0 | ||
composer require auth0/auth0-php | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
path: app/Plugin/${{ env.PLUGIN_CODE }} | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: PHPStan | ||
run: | | ||
composer require phpstan/phpstan --dev | ||
./vendor/bin/phpstan analyze app/Plugin/${{ env.PLUGIN_CODE }} -c "app/Plugin/${{ env.PLUGIN_CODE }}/phpstan.neon" --error-format=github | ||
- uses: kurozumi/eccube-plugin-phpstan@v1.0.1 | ||
with: | ||
plugin-code: ${{ env.PLUGIN_CODE }} | ||
plugin-package-name: ${{ env.PLUGIN_PACKAGE_NAME }} | ||
eccube-versions: ${{ matrix.eccube-versions }} | ||
php-versions: ${{ matrix.php-versions }} | ||
database-url: ${{ matrix.database_url }} | ||
database-server-version: ${{ matrix.database_server_version }} | ||
database-charset: ${{ matrix.database_charset }} | ||
command: 'composer config --no-plugins allow-plugins.php-http/discovery false' |
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
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,21 @@ | ||
<?php | ||
|
||
namespace Plugin\Auth0\Tests\DependencyInjection; | ||
|
||
use Plugin\Auth0\DependencyInjection\Auth0Extension; | ||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
|
||
class Auth0ExtensionTest extends KernelTestCase | ||
{ | ||
public function testプラグインが無効化されていたらAuth0Authenticatorは追加されない() | ||
{ | ||
$container = $this->createMock(ContainerBuilder::class); | ||
$container->expects($this->once()) | ||
->method('getParameter') | ||
->willReturn([]); | ||
|
||
$extension = new Auth0Extension(); | ||
$extension->prepend($container); | ||
} | ||
} |