-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds support for Symfony 4+ by adding a compiler pass to mark services as public. Also expands composer constraints to support php 8 and phpunit 8 & 9.
- Loading branch information
1 parent
1f0763b
commit 11b82a9
Showing
5 changed files
with
54 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,31 @@ | ||
name: CI | ||
|
||
on: [push] | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
build-test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
phpunit: [6.5.13, 7.5.18, 8.5.31, 9.5.26] | ||
php: [7.3, 7.4] | ||
phpunit: [6.5.13, 7.5.18] | ||
include: | ||
- phpunit: 8.5.31 | ||
php: 8.0 | ||
- phpunit: 9.5.26 | ||
php: 8.0 | ||
- phpunit: 9.5.26 | ||
php: 8.1 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: php-actions/composer@v6.0.0 | ||
- uses: php-actions/composer@v6.1.1 | ||
with: | ||
php_version: ${{ matrix.php }} | ||
|
||
- name: PHPUnit Tests | ||
uses: php-actions/[email protected].0 | ||
uses: php-actions/[email protected].2 | ||
with: | ||
php_version: ${{ matrix.php }} | ||
version: ${{ matrix.phpunit }} |
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
31 changes: 31 additions & 0 deletions
31
src/Compiler/PhpUnitBehatPublicContainerDefinitionCompiler.php
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,31 @@ | ||
<?php | ||
|
||
namespace PHPUnitBehat\Compiler; | ||
|
||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
|
||
/** | ||
* Mark all service definitions as public in order to | ||
* be able to get the services directly from the container. | ||
*/ | ||
class PhpUnitBehatPublicContainerDefinitionCompiler implements CompilerPassInterface { | ||
|
||
/** | ||
* Process service`s definitions. | ||
* | ||
* @param \Symfony\Component\DependencyInjection\ContainerBuilder $container | ||
* The service`s container. | ||
* | ||
* @return void | ||
*/ | ||
public function process(ContainerBuilder $container) | ||
{ | ||
foreach ($container->getDefinitions() as $definition) { | ||
// Mark all service definitions as public in order to | ||
// be able to get the services directly from the container. | ||
$definition->setPublic(TRUE); | ||
} | ||
} | ||
|
||
} |
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