This repository has been archived by the owner on Jun 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from Converia/master
Event dispatcher
- Loading branch information
Showing
6 changed files
with
132 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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: boellmann | ||
* Date: 02.10.18 | ||
* Time: 14:38 | ||
*/ | ||
|
||
namespace DoL\LdapBundle\Event; | ||
|
||
|
||
use Symfony\Component\EventDispatcher\Event; | ||
|
||
class SwitchParameterSetEvent extends Event | ||
{ | ||
const PARAMETERSET = 'dol_ldap.manager.switch_parameter_set'; | ||
|
||
private $parameterSet = []; | ||
|
||
/** | ||
* SwitchParameterSet constructor. | ||
* @param array $parameterSet | ||
*/ | ||
public function __construct(array $parameterSet) | ||
{ | ||
$this->parameterSet = $parameterSet; | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function getParameterSet(): array | ||
{ | ||
return $this->parameterSet; | ||
} | ||
|
||
} |
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,50 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: boellmann | ||
* Date: 02.10.18 | ||
* Time: 14:44 | ||
*/ | ||
|
||
namespace DoL\LdapBundle\Event; | ||
|
||
|
||
class SwitchParameterSetEventTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @var SwitchParameterSetEvent | ||
*/ | ||
private $event; | ||
/** | ||
* @var array | ||
*/ | ||
private $parameter; | ||
|
||
protected function setUp() | ||
{ | ||
$this->parameter = [ | ||
'driver' => [ | ||
// SOME ATTRIBUTES | ||
], | ||
'user' => [ | ||
'baseDn' => 'ou=Groups,dc=example,dc=com', | ||
'filter' => '(attr0=value0)', | ||
'attributes' => [ | ||
[ | ||
'ldap_attr' => 'uid', | ||
'user_method' => 'setUsername', | ||
], | ||
], | ||
], | ||
]; | ||
$this->event = new SwitchParameterSetEvent($this->parameter); | ||
} | ||
|
||
|
||
public function testGetter() | ||
{ | ||
$this->assertTrue(is_array($this->event->getParameterSet())); | ||
$this->assertArraySubset($this->parameter,$this->event->getParameterSet()); | ||
} | ||
|
||
} |
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