Skip to content

Commit

Permalink
Merge pull request #1 from playtini/fixes
Browse files Browse the repository at this point in the history
fixes, updated twig version
  • Loading branch information
overgapo authored Feb 17, 2017
2 parents e928935 + 0a5f6ab commit 79fc232
Show file tree
Hide file tree
Showing 4 changed files with 216 additions and 151 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;

class AuthExtension extends Extension implements PrependExtensionInterface
class PlaytiniAuthExtension extends Extension implements PrependExtensionInterface
{
/**
* @param ContainerBuilder $container
Expand All @@ -29,7 +29,7 @@ public function prepend(ContainerBuilder $container)
// Optional value for sending access_type parameter. More detail: https://developers.google.com/identity/protocols/OAuth2WebServer#offline
'access_type' => 'online',
// Optional value for sending hd parameter. More detail: https://developers.google.com/accounts/docs/OAuth2Login#hd-param
//'hosted_domain' => 'yourdomain.com',
'hosted_domain' => $container->getParameter('google_app_domain'),
// whether to check OAuth2 "state": defaults to true
'use_state' => false
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@

namespace Playtini\Tests\Bundle\AppBundle\DependencyInjection;

use Playtini\Bundle\AuthBundle\DependencyInjection\AuthExtension;
use Playtini\Bundle\AuthBundle\DependencyInjection\PlaytiniAuthExtension;
use Symfony\Component\DependencyInjection\ContainerBuilder;

/**
* @covers \Playtini\Bundle\AuthBundle\DependencyInjection\AuthExtension
* @covers \Playtini\Bundle\AuthBundle\DependencyInjection\PlaytiniAuthExtension
*/
class AuthExtensionTest extends \PHPUnit_Framework_TestCase
class PlaytiniAuthExtensionTest extends \PHPUnit_Framework_TestCase
{
public function testPrepend()
{
$container = new ContainerBuilder();
$container->setParameter('google_app_id', '123asd321');
$container->setParameter('google_app_secret', 'asd123dsa');
$loader = new AuthExtension();
$container->setParameter('google_app_domain', 'playtini.ua');
$loader = new PlaytiniAuthExtension();
$loader->prepend($container);
$expected = [
'clients' => [
Expand All @@ -26,7 +27,7 @@ public function testPrepend()
'redirect_route' => 'playtini_auth_connect_google_check',
'redirect_params' => [],
'access_type' => 'online',
//'hosted_domain' => 'yourdomain.com',
'hosted_domain' => 'playtini.ua',
'use_state' => false
]
]
Expand All @@ -37,7 +38,7 @@ public function testPrepend()
public function testLoad()
{
$container = new ContainerBuilder();
$loader = new AuthExtension();
$loader = new PlaytiniAuthExtension();
$config = [];
$loader->load([$config], $container);

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"php": ">=7.0",
"knpuniversity/oauth2-client-bundle": "^1.1",
"league/oauth2-google": "^1.0",
"twig/twig": "^1.24",
"twig/twig": "^2.1",
"symfony/security-guard": "^3.0",
"doctrine/doctrine-bundle": "^1.6"
},
Expand All @@ -35,7 +35,7 @@
},
"config": {
"platform": {
"php": "7.0"
"php": "7.1"
}
}
}
Loading

0 comments on commit 79fc232

Please sign in to comment.