Skip to content

Commit

Permalink
Add "friendsofsymfony/user-bundle" to development dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
phansys committed Jul 5, 2020
1 parent f2a52e1 commit b48b755
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 31 deletions.
41 changes: 12 additions & 29 deletions Tests/Functional/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,21 @@

namespace Hackzilla\Bundle\TicketBundle\Tests\Functional\Entity;

use Hackzilla\Bundle\TicketBundle\Model\UserInterface;
use Doctrine\ORM\Mapping as ORM;
use FOS\UserBundle\Model\User as BaseUser;

/**
* @ORM\Entity
* @ORM\Table(name="fos_user")
*
* @author Javier Spagnoletti <phansys@gmail.com>
*/
final class User implements UserInterface
class User extends BaseUser
{
public function getId()
{
}

public function getUsername()
{
}

public function getEmail()
{
}

public function getRoles()
{
}

public function getPassword()
{
}

public function getSalt()
{
}

public function eraseCredentials()
{
}
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
}
35 changes: 33 additions & 2 deletions Tests/Functional/TestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Hackzilla\Bundle\TicketBundle\Tests\Functional;

use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
use FOS\UserBundle\FOSUserBundle;
use Hackzilla\Bundle\TicketBundle\HackzillaTicketBundle;
use Hackzilla\Bundle\TicketBundle\Tests\Functional\Entity\User;
use Knp\Bundle\PaginatorBundle\KnpPaginatorBundle;
Expand Down Expand Up @@ -41,6 +42,7 @@ public function registerBundles()
new FrameworkBundle(),
new SecurityBundle(),
new DoctrineBundle(),
new FOSUserBundle(),
new KnpPaginatorBundle(),
new TwigBundle(),
new HackzillaTicketBundle(),
Expand Down Expand Up @@ -96,6 +98,11 @@ protected function configureContainer(ContainerBuilder $c, LoaderInterface $load
$c->loadFromExtension('framework', [
'secret' => 'MySecretKey',
'default_locale' => 'en',
'session' => [
'handler_id' => 'session.handler.native_file',
'storage_id' => 'session.storage.mock_file',
'name' => 'MOCKSESSID',
],
'translator' => [
'fallbacks' => [
'en',
Expand Down Expand Up @@ -131,20 +138,44 @@ protected function configureContainer(ContainerBuilder $c, LoaderInterface $load
],
'orm' => [
'default_entity_manager' => 'default',
'auto_mapping' => true,
'mappings' => [
'HackzillaTicketBundle' => [
'dir' => __DIR__.'/Entity',
'prefix' => 'Hackzilla\Bundle\TicketBundle\Tests\Functional\Entity',
'alias' => 'HackzillaTicketBundle',
'type' => 'annotation',
],
],
],
]);

// TwigBundle config
$twigConfig = [
'strict_variables' => '%kernel.debug%',
'autoescape' => 'name',
'strict_variables' => '%kernel.debug%',
'exception_controller' => null,
'autoescape' => 'name',
];
// "default_path" configuration is available since version 3.4.
if (version_compare(self::VERSION, '3.4', '>=')) {
$twigConfig['default_path'] = __DIR__.'/Resources/views';
}
$c->loadFromExtension('twig', $twigConfig);

// FOSUserBundle config
$c->loadFromExtension('fos_user', [
'user_class' => User::class,
'db_driver' => 'orm',
'firewall_name' => 'api',
'from_email' => [
'address' => 'no-reply@example.com',
'sender_name' => 'HackzillaTicketBundle',
],
'service' => [
'mailer' => 'fos_user.mailer.noop',
],
]);

// HackzillaBundle config
$c->loadFromExtension('hackzilla_ticket', [
'user_class' => User::class,
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"require-dev": {
"ext-pdo_sqlite": "*",
"friendsofphp/php-cs-fixer": "^1.4 || ^2.0",
"friendsofsymfony/user-bundle": "^1.3 || ^2.1",
"phpstan/phpstan": "^0.12.32",
"phpunit/phpunit": ">=5.4.3,<8.0",
"symfony/phpunit-bridge": "^3.2 || ^4.0",
Expand Down

0 comments on commit b48b755

Please sign in to comment.