-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yohan Giarelli
committed
Jan 13, 2025
1 parent
af75644
commit d89f1cd
Showing
12 changed files
with
116 additions
and
35 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,8 +1,4 @@ | ||
vendor | ||
build | ||
bin | ||
composer.phar | ||
tests/Extension/Symfony/fixtures/app/var/ | ||
vendor/ | ||
.phpunit.result.cache | ||
composer.lock | ||
cache.properties | ||
coverage.clover | ||
docs/_build |
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,10 +1,4 @@ | ||
tests/Extension/Symfony/fixtures/app/var/ | ||
vendor/ | ||
.phpunit.result.cache | ||
vendor | ||
build | ||
bin | ||
composer.phar | ||
composer.lock | ||
cache.properties | ||
coverage.clover | ||
docs/_build | ||
.phpunit.result.cache |
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
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
23 changes: 23 additions & 0 deletions
23
src/Extension/Symfony/Bundle/DependencyInjection/FiniteExtension.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,23 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Finite\Extension\Symfony\Bundle\DependencyInjection; | ||
|
||
use Finite\Extension\Twig\FiniteExtension as TwigExtension; | ||
use Finite\StateMachine; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\DependencyInjection\Definition; | ||
use Symfony\Component\DependencyInjection\Extension\Extension; | ||
|
||
final class FiniteExtension extends Extension | ||
{ | ||
public function load(array $configs, ContainerBuilder $container): void | ||
{ | ||
$container->addDefinitions( | ||
[ | ||
StateMachine::class => (new Definition(StateMachine::class))->setPublic(true), | ||
TwigExtension::class => new Definition(TwigExtension::class), | ||
] | ||
); | ||
} | ||
} |
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 | ||
declare(strict_types=1); | ||
|
||
namespace Finite\Extension\Symfony\Bundle; | ||
|
||
use Symfony\Component\HttpKernel\Bundle\Bundle; | ||
|
||
final class FiniteBundle extends Bundle | ||
{ | ||
} |
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,25 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Finite\Tests\Extension\Symfony; | ||
|
||
use Finite\Extension\Twig\FiniteExtension; | ||
use Finite\StateMachine; | ||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; | ||
use Symfony\Bundle\FrameworkBundle\Test\TestContainer; | ||
|
||
class ServiceTest extends KernelTestCase | ||
{ | ||
public function test_services_are_registered(): void | ||
{ | ||
/** @var TestContainer $container */ | ||
$container = static::getContainer(); | ||
|
||
$this->assertInstanceOf(StateMachine::class, $container->get(StateMachine::class)); | ||
} | ||
|
||
protected static function getKernelClass(): string | ||
{ | ||
return \AppKernel::class; | ||
} | ||
} |
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 | ||
declare(strict_types=1); | ||
|
||
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; | ||
use Symfony\Component\Config\Loader\LoaderInterface; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\HttpKernel\Kernel; | ||
|
||
class AppKernel extends Kernel | ||
{ | ||
use MicroKernelTrait; | ||
|
||
public function registerBundles(): iterable | ||
{ | ||
return [ | ||
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), | ||
new Finite\Extension\Symfony\Bundle\FiniteBundle(), | ||
]; | ||
} | ||
|
||
protected function configureContainer(ContainerBuilder $c, LoaderInterface $loader): void | ||
{ | ||
$c->prependExtensionConfig('framework', ['test' => true]); | ||
} | ||
|
||
public function getProjectDir(): string | ||
{ | ||
return __DIR__; | ||
} | ||
|
||
} |
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 | ||
declare(strict_types=1); | ||
|
||
$loader = require __DIR__ . '/../../../../../vendor/autoload.php'; | ||
require __DIR__.'/AppKernel.php'; | ||
|
||
return $loader; |
This file was deleted.
Oops, something went wrong.