-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Showing
12 changed files
with
360 additions
and
364 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
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
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,81 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the NucleosProfileBundle package. | ||
* | ||
* (c) Christian Gripp <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\DependencyInjection\Loader\Configurator; | ||
|
||
use Nucleos\ProfileBundle\Tests\App\Entity\TestGroup; | ||
use Nucleos\ProfileBundle\Tests\App\Entity\TestUser; | ||
use Nucleos\UserBundle\Model\UserInterface; | ||
use Symfony\Component\Security\Http\Attribute\IsGranted; | ||
|
||
return static function (ContainerConfigurator $containerConfigurator): void { | ||
$containerConfigurator->extension('framework', ['secret' => 'secret']); | ||
|
||
$containerConfigurator->extension('framework', ['test' => true]); | ||
|
||
$containerConfigurator->extension('framework', ['session' => ['storage_factory_id' => 'session.storage.factory.mock_file', 'handler_id' => null]]); | ||
|
||
$containerConfigurator->extension('twig', ['strict_variables' => true]); | ||
|
||
$containerConfigurator->extension('twig', ['exception_controller' => null]); | ||
|
||
$containerConfigurator->extension('doctrine', ['dbal' => ['url' => 'sqlite:///%kernel.cache_dir%/data.db', 'logging' => false, 'use_savepoints' => true]]); | ||
|
||
$containerConfigurator->extension('doctrine', ['orm' => [ | ||
'auto_mapping' => true, | ||
'mappings' => [ | ||
'App' => [ | ||
'is_bundle' => false, | ||
'type' => 'attribute', | ||
'dir' => '%kernel.project_dir%/Entity', | ||
'prefix' => 'Nucleos\ProfileBundle\Tests\App\Entity', | ||
'alias' => 'App', | ||
], | ||
], | ||
]]); | ||
|
||
$securityConfig = [ | ||
'firewalls' => ['main' => ['security' => true]], | ||
]; | ||
|
||
// TODO: Remove if when dropping support of Symfony 5.4 | ||
if (!class_exists(IsGranted::class)) { | ||
$securityConfig['enable_authenticator_manager'] = true; | ||
} | ||
|
||
$containerConfigurator->extension('security', $securityConfig); | ||
|
||
$containerConfigurator->extension('security', [ | ||
'providers' => ['nucleos_userbundle' => ['id' => 'nucleos_user.user_provider.username']], | ||
]); | ||
|
||
$containerConfigurator->extension('security', ['access_control' => [ | ||
['path' => '^/.*', 'role' => 'PUBLIC_ACCESS'], | ||
]]); | ||
|
||
$containerConfigurator->extension('security', ['password_hashers' => [UserInterface::class => [ | ||
'algorithm' => 'plaintext', | ||
]]]); | ||
|
||
$containerConfigurator->extension('nucleos_user', ['db_driver' => 'orm']); | ||
|
||
$containerConfigurator->extension('nucleos_user', ['firewall_name' => 'main']); | ||
|
||
$containerConfigurator->extension('nucleos_user', ['from_email' => 'no-reply@localhost']); | ||
|
||
$containerConfigurator->extension('nucleos_user', ['user_class' => TestUser::class]); | ||
|
||
$containerConfigurator->extension('nucleos_user', ['group' => ['group_class' => TestGroup::class]]); | ||
|
||
$containerConfigurator->extension('nucleos_user', ['loggedin' => ['route' => 'home']]); | ||
}; |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.