@@ -1,86 +1,86 @@ |
||
1 | 1 | <?php |
2 | 2 | // Generated by ZF2's ./bin/classmap_generator.php |
3 | 3 | return array( |
4 | - 'Applications\Acl\ApplicationAccessAssertion' => __DIR__ . '/Applications/Acl/ApplicationAccessAssertion.php', |
|
5 | - 'Applications\Auth\Dependency\ListListener' => __DIR__ . '/Applications/Auth/Dependency/ListListener.php', |
|
6 | - 'Applications\Controller\ApplyController' => __DIR__ . '/Applications/Controller/ApplyController.php', |
|
7 | - 'Applications\Controller\CommentController' => __DIR__ . '/Applications/Controller/CommentController.php', |
|
8 | - 'Applications\Controller\ConsoleController' => __DIR__ . '/Applications/Controller/ConsoleController.php', |
|
9 | - 'Applications\Controller\IndexController' => __DIR__ . '/Applications/Controller/IndexController.php', |
|
10 | - 'Applications\Controller\ManageController' => __DIR__ . '/Applications/Controller/ManageController.php', |
|
11 | - 'Applications\Controller\MultimanageController' => __DIR__ . '/Applications/Controller/MultimanageController.php', |
|
12 | - 'Applications\Controller\Plugin\StatusChanger' => __DIR__ . '/Applications/Controller/Plugin/StatusChanger.php', |
|
13 | - 'Applications\Entity\Application' => __DIR__ . '/Applications/Entity/Application.php', |
|
14 | - 'Applications\Entity\ApplicationInterface' => __DIR__ . '/Applications/Entity/ApplicationInterface.php', |
|
15 | - 'Applications\Entity\Attachment' => __DIR__ . '/Applications/Entity/Attachment.php', |
|
16 | - 'Applications\Entity\Attributes' => __DIR__ . '/Applications/Entity/Attributes.php', |
|
17 | - 'Applications\Entity\Comment' => __DIR__ . '/Applications/Entity/Comment.php', |
|
18 | - 'Applications\Entity\CommentInterface' => __DIR__ . '/Applications/Entity/CommentInterface.php', |
|
19 | - 'Applications\Entity\Contact' => __DIR__ . '/Applications/Entity/Contact.php', |
|
20 | - 'Applications\Entity\Cv' => __DIR__ . '/Applications/Entity/Cv.php', |
|
21 | - 'Applications\Entity\Facts' => __DIR__ . '/Applications/Entity/Facts.php', |
|
22 | - 'Applications\Entity\FactsInterface' => __DIR__ . '/Applications/Entity/FactsInterface.php', |
|
23 | - 'Applications\Entity\History' => __DIR__ . '/Applications/Entity/History.php', |
|
24 | - 'Applications\Entity\HistoryInterface' => __DIR__ . '/Applications/Entity/HistoryInterface.php', |
|
25 | - 'Applications\Entity\InternalReferences' => __DIR__ . '/Applications/Entity/InternalReferences.php', |
|
26 | - 'Applications\Entity\MailHistory' => __DIR__ . '/Applications/Entity/MailHistory.php', |
|
27 | - 'Applications\Entity\MailHistoryInterface' => __DIR__ . '/Applications/Entity/MailHistoryInterface.php', |
|
28 | - 'Applications\Entity\Rating' => __DIR__ . '/Applications/Entity/Rating.php', |
|
29 | - 'Applications\Entity\RatingInterface' => __DIR__ . '/Applications/Entity/RatingInterface.php', |
|
30 | - 'Applications\Entity\Settings' => __DIR__ . '/Applications/Entity/Settings.php', |
|
31 | - 'Applications\Entity\SettingsInterface' => __DIR__ . '/Applications/Entity/SettingsInterface.php', |
|
32 | - 'Applications\Entity\Status' => __DIR__ . '/Applications/Entity/Status.php', |
|
33 | - 'Applications\Entity\StatusInterface' => __DIR__ . '/Applications/Entity/StatusInterface.php', |
|
34 | - 'Applications\Entity\Subscriber' => __DIR__ . '/Applications/Entity/Subscriber.php', |
|
35 | - 'Applications\Entity\SubscriberInterface' => __DIR__ . '/Applications/Entity/SubscriberInterface.php', |
|
36 | - 'Applications\Entity\Validator\Application' => __DIR__ . '/Applications/Entity/Validator/Application.php', |
|
37 | - 'Applications\Factory\Auth\Dependency\ListListenerFactory' => __DIR__ . '/Applications/Factory/Auth/Dependency/ListListenerFactory.php', |
|
38 | - 'Applications\Factory\Form\AttachmentsFactory' => __DIR__ . '/Applications/Factory/Form/AttachmentsFactory.php', |
|
39 | - 'Applications\Factory\Form\ContactImageFactory' => __DIR__ . '/Applications/Factory/Form/ContactImageFactory.php', |
|
40 | - 'Applications\Factory\Form\JobSelectFactory' => __DIR__ . '/Applications/Factory/Form/JobSelectFactory.php', |
|
41 | - 'Applications\Factory\Form\StatusSelectFactory' => __DIR__ . '/Applications/Factory/Form/StatusSelectFactory.php', |
|
42 | - 'Applications\Factory\Listener\EventApplicationCreatedFactory' => __DIR__ . '/Applications/Factory/Listener/EventApplicationCreatedFactory.php', |
|
43 | - 'Applications\Factory\Listener\JobSelectValuesFactory' => __DIR__ . '/Applications/Factory/Listener/JobSelectValuesFactory.php', |
|
44 | - 'Applications\Factory\Listener\StatusChangeFactory' => __DIR__ . '/Applications/Factory/Listener/StatusChangeFactory.php', |
|
45 | - 'Applications\Factory\Mail\ConfirmationFactory' => __DIR__ . '/Applications/Factory/Mail/ConfirmationFactory.php', |
|
46 | - 'Applications\Factory\Mail\NewApplicationFactory' => __DIR__ . '/Applications/Factory/Mail/NewApplicationFactory.php', |
|
47 | - 'Applications\Factory\ModuleOptionsFactory' => __DIR__ . '/Applications/Factory/ModuleOptionsFactory.php', |
|
48 | - 'Applications\Factory\Paginator\JobSelectPaginatorFactory' => __DIR__ . '/Applications/Factory/Paginator/JobSelectPaginatorFactory.php', |
|
49 | - 'Applications\Filter\ActionToStatus' => __DIR__ . '/Applications/Filter/ActionToStatus.php', |
|
50 | - 'Applications\Form\ApplicationsFilter' => __DIR__ . '/Applications/Form/ApplicationsFilter.php', |
|
51 | - 'Applications\Form\Apply' => __DIR__ . '/Applications/Form/Apply.php', |
|
52 | - 'Applications\Form\Attributes' => __DIR__ . '/Applications/Form/Attributes.php', |
|
53 | - 'Applications\Form\Base' => __DIR__ . '/Applications/Form/Base.php', |
|
54 | - 'Applications\Form\BaseFieldset' => __DIR__ . '/Applications/Form/BaseFieldset.php', |
|
55 | - 'Applications\Form\CarbonCopyFieldset' => __DIR__ . '/Applications/Form/CarbonCopyFieldset.php', |
|
56 | - 'Applications\Form\CommentForm' => __DIR__ . '/Applications/Form/CommentForm.php', |
|
57 | - 'Applications\Form\ContactContainer' => __DIR__ . '/Applications/Form/ContactContainer.php', |
|
58 | - 'Applications\Form\Element\JobSelect' => __DIR__ . '/Applications/Form/Element/JobSelect.php', |
|
59 | - 'Applications\Form\Element\Ref' => __DIR__ . '/Applications/Form/Element/Ref.php', |
|
60 | - 'Applications\Form\Facts' => __DIR__ . '/Applications/Form/Facts.php', |
|
61 | - 'Applications\Form\FactsFieldset' => __DIR__ . '/Applications/Form/FactsFieldset.php', |
|
62 | - 'Applications\Form\Mail' => __DIR__ . '/Applications/Form/Mail.php', |
|
63 | - 'Applications\Form\SettingsFieldset' => __DIR__ . '/Applications/Form/SettingsFieldset.php', |
|
64 | - 'Applications\Listener\EventApplicationCreated' => __DIR__ . '/Applications/Listener/EventApplicationCreated.php', |
|
65 | - 'Applications\Listener\Events\ApplicationEvent' => __DIR__ . '/Applications/Listener/Events/ApplicationEvent.php', |
|
66 | - 'Applications\Listener\JobSelectValues' => __DIR__ . '/Applications/Listener/JobSelectValues.php', |
|
67 | - 'Applications\Listener\StatusChange' => __DIR__ . '/Applications/Listener/StatusChange.php', |
|
68 | - 'Applications\Mail\AcceptApplication' => __DIR__ . '/Applications/Mail/AcceptApplication.php', |
|
69 | - 'Applications\Mail\ApplicationCarbonCopy' => __DIR__ . '/Applications/Mail/ApplicationCarbonCopy.php', |
|
70 | - 'Applications\Mail\Confirmation' => __DIR__ . '/Applications/Mail/Confirmation.php', |
|
71 | - 'Applications\Mail\Forward' => __DIR__ . '/Applications/Mail/Forward.php', |
|
72 | - 'Applications\Mail\NewApplication' => __DIR__ . '/Applications/Mail/NewApplication.php', |
|
73 | - 'Applications\Mail\StatusChange' => __DIR__ . '/Applications/Mail/StatusChange.php', |
|
74 | - 'Applications\Mail\StatusChangeInterface' => __DIR__ . '/Applications/Mail/StatusChangeInterface.php', |
|
75 | - 'Applications\Options\ModuleOptions' => __DIR__ . '/Applications/Options/ModuleOptions.php', |
|
76 | - 'Applications\Paginator\JobSelectPaginator' => __DIR__ . '/Applications/Paginator/JobSelectPaginator.php', |
|
77 | - 'Applications\Repository\Application' => __DIR__ . '/Applications/Repository/Application.php', |
|
78 | - 'Applications\Repository\Event\DeleteRemovedAttachmentsSubscriber' => __DIR__ . '/Applications/Repository/Event/DeleteRemovedAttachmentsSubscriber.php', |
|
79 | - 'Applications\Repository\Event\JobReferencesUpdateListener' => __DIR__ . '/Applications/Repository/Event/JobReferencesUpdateListener.php', |
|
80 | - 'Applications\Repository\Event\UpdateFilesPermissionsSubscriber' => __DIR__ . '/Applications/Repository/Event/UpdateFilesPermissionsSubscriber.php', |
|
81 | - 'Applications\Repository\Event\UpdatePermissionsSubscriber' => __DIR__ . '/Applications/Repository/Event/UpdatePermissionsSubscriber.php', |
|
82 | - 'Applications\Repository\Filter\PaginationQuery' => __DIR__ . '/Applications/Repository/Filter/PaginationQuery.php', |
|
83 | - 'Applications\Repository\Filter\PaginationQueryFactory' => __DIR__ . '/Applications/Repository/Filter/PaginationQueryFactory.php', |
|
84 | - 'Applications\Repository\PaginationList' => __DIR__ . '/Applications/Repository/PaginationList.php', |
|
85 | - 'Applications\Repository\Subscriber' => __DIR__ . '/Applications/Repository/Subscriber.php', |
|
4 | + 'Applications\Acl\ApplicationAccessAssertion' => __DIR__.'/Applications/Acl/ApplicationAccessAssertion.php', |
|
5 | + 'Applications\Auth\Dependency\ListListener' => __DIR__.'/Applications/Auth/Dependency/ListListener.php', |
|
6 | + 'Applications\Controller\ApplyController' => __DIR__.'/Applications/Controller/ApplyController.php', |
|
7 | + 'Applications\Controller\CommentController' => __DIR__.'/Applications/Controller/CommentController.php', |
|
8 | + 'Applications\Controller\ConsoleController' => __DIR__.'/Applications/Controller/ConsoleController.php', |
|
9 | + 'Applications\Controller\IndexController' => __DIR__.'/Applications/Controller/IndexController.php', |
|
10 | + 'Applications\Controller\ManageController' => __DIR__.'/Applications/Controller/ManageController.php', |
|
11 | + 'Applications\Controller\MultimanageController' => __DIR__.'/Applications/Controller/MultimanageController.php', |
|
12 | + 'Applications\Controller\Plugin\StatusChanger' => __DIR__.'/Applications/Controller/Plugin/StatusChanger.php', |
|
13 | + 'Applications\Entity\Application' => __DIR__.'/Applications/Entity/Application.php', |
|
14 | + 'Applications\Entity\ApplicationInterface' => __DIR__.'/Applications/Entity/ApplicationInterface.php', |
|
15 | + 'Applications\Entity\Attachment' => __DIR__.'/Applications/Entity/Attachment.php', |
|
16 | + 'Applications\Entity\Attributes' => __DIR__.'/Applications/Entity/Attributes.php', |
|
17 | + 'Applications\Entity\Comment' => __DIR__.'/Applications/Entity/Comment.php', |
|
18 | + 'Applications\Entity\CommentInterface' => __DIR__.'/Applications/Entity/CommentInterface.php', |
|
19 | + 'Applications\Entity\Contact' => __DIR__.'/Applications/Entity/Contact.php', |
|
20 | + 'Applications\Entity\Cv' => __DIR__.'/Applications/Entity/Cv.php', |
|
21 | + 'Applications\Entity\Facts' => __DIR__.'/Applications/Entity/Facts.php', |
|
22 | + 'Applications\Entity\FactsInterface' => __DIR__.'/Applications/Entity/FactsInterface.php', |
|
23 | + 'Applications\Entity\History' => __DIR__.'/Applications/Entity/History.php', |
|
24 | + 'Applications\Entity\HistoryInterface' => __DIR__.'/Applications/Entity/HistoryInterface.php', |
|
25 | + 'Applications\Entity\InternalReferences' => __DIR__.'/Applications/Entity/InternalReferences.php', |
|
26 | + 'Applications\Entity\MailHistory' => __DIR__.'/Applications/Entity/MailHistory.php', |
|
27 | + 'Applications\Entity\MailHistoryInterface' => __DIR__.'/Applications/Entity/MailHistoryInterface.php', |
|
28 | + 'Applications\Entity\Rating' => __DIR__.'/Applications/Entity/Rating.php', |
|
29 | + 'Applications\Entity\RatingInterface' => __DIR__.'/Applications/Entity/RatingInterface.php', |
|
30 | + 'Applications\Entity\Settings' => __DIR__.'/Applications/Entity/Settings.php', |
|
31 | + 'Applications\Entity\SettingsInterface' => __DIR__.'/Applications/Entity/SettingsInterface.php', |
|
32 | + 'Applications\Entity\Status' => __DIR__.'/Applications/Entity/Status.php', |
|
33 | + 'Applications\Entity\StatusInterface' => __DIR__.'/Applications/Entity/StatusInterface.php', |
|
34 | + 'Applications\Entity\Subscriber' => __DIR__.'/Applications/Entity/Subscriber.php', |
|
35 | + 'Applications\Entity\SubscriberInterface' => __DIR__.'/Applications/Entity/SubscriberInterface.php', |
|
36 | + 'Applications\Entity\Validator\Application' => __DIR__.'/Applications/Entity/Validator/Application.php', |
|
37 | + 'Applications\Factory\Auth\Dependency\ListListenerFactory' => __DIR__.'/Applications/Factory/Auth/Dependency/ListListenerFactory.php', |
|
38 | + 'Applications\Factory\Form\AttachmentsFactory' => __DIR__.'/Applications/Factory/Form/AttachmentsFactory.php', |
|
39 | + 'Applications\Factory\Form\ContactImageFactory' => __DIR__.'/Applications/Factory/Form/ContactImageFactory.php', |
|
40 | + 'Applications\Factory\Form\JobSelectFactory' => __DIR__.'/Applications/Factory/Form/JobSelectFactory.php', |
|
41 | + 'Applications\Factory\Form\StatusSelectFactory' => __DIR__.'/Applications/Factory/Form/StatusSelectFactory.php', |
|
42 | + 'Applications\Factory\Listener\EventApplicationCreatedFactory' => __DIR__.'/Applications/Factory/Listener/EventApplicationCreatedFactory.php', |
|
43 | + 'Applications\Factory\Listener\JobSelectValuesFactory' => __DIR__.'/Applications/Factory/Listener/JobSelectValuesFactory.php', |
|
44 | + 'Applications\Factory\Listener\StatusChangeFactory' => __DIR__.'/Applications/Factory/Listener/StatusChangeFactory.php', |
|
45 | + 'Applications\Factory\Mail\ConfirmationFactory' => __DIR__.'/Applications/Factory/Mail/ConfirmationFactory.php', |
|
46 | + 'Applications\Factory\Mail\NewApplicationFactory' => __DIR__.'/Applications/Factory/Mail/NewApplicationFactory.php', |
|
47 | + 'Applications\Factory\ModuleOptionsFactory' => __DIR__.'/Applications/Factory/ModuleOptionsFactory.php', |
|
48 | + 'Applications\Factory\Paginator\JobSelectPaginatorFactory' => __DIR__.'/Applications/Factory/Paginator/JobSelectPaginatorFactory.php', |
|
49 | + 'Applications\Filter\ActionToStatus' => __DIR__.'/Applications/Filter/ActionToStatus.php', |
|
50 | + 'Applications\Form\ApplicationsFilter' => __DIR__.'/Applications/Form/ApplicationsFilter.php', |
|
51 | + 'Applications\Form\Apply' => __DIR__.'/Applications/Form/Apply.php', |
|
52 | + 'Applications\Form\Attributes' => __DIR__.'/Applications/Form/Attributes.php', |
|
53 | + 'Applications\Form\Base' => __DIR__.'/Applications/Form/Base.php', |
|
54 | + 'Applications\Form\BaseFieldset' => __DIR__.'/Applications/Form/BaseFieldset.php', |
|
55 | + 'Applications\Form\CarbonCopyFieldset' => __DIR__.'/Applications/Form/CarbonCopyFieldset.php', |
|
56 | + 'Applications\Form\CommentForm' => __DIR__.'/Applications/Form/CommentForm.php', |
|
57 | + 'Applications\Form\ContactContainer' => __DIR__.'/Applications/Form/ContactContainer.php', |
|
58 | + 'Applications\Form\Element\JobSelect' => __DIR__.'/Applications/Form/Element/JobSelect.php', |
|
59 | + 'Applications\Form\Element\Ref' => __DIR__.'/Applications/Form/Element/Ref.php', |
|
60 | + 'Applications\Form\Facts' => __DIR__.'/Applications/Form/Facts.php', |
|
61 | + 'Applications\Form\FactsFieldset' => __DIR__.'/Applications/Form/FactsFieldset.php', |
|
62 | + 'Applications\Form\Mail' => __DIR__.'/Applications/Form/Mail.php', |
|
63 | + 'Applications\Form\SettingsFieldset' => __DIR__.'/Applications/Form/SettingsFieldset.php', |
|
64 | + 'Applications\Listener\EventApplicationCreated' => __DIR__.'/Applications/Listener/EventApplicationCreated.php', |
|
65 | + 'Applications\Listener\Events\ApplicationEvent' => __DIR__.'/Applications/Listener/Events/ApplicationEvent.php', |
|
66 | + 'Applications\Listener\JobSelectValues' => __DIR__.'/Applications/Listener/JobSelectValues.php', |
|
67 | + 'Applications\Listener\StatusChange' => __DIR__.'/Applications/Listener/StatusChange.php', |
|
68 | + 'Applications\Mail\AcceptApplication' => __DIR__.'/Applications/Mail/AcceptApplication.php', |
|
69 | + 'Applications\Mail\ApplicationCarbonCopy' => __DIR__.'/Applications/Mail/ApplicationCarbonCopy.php', |
|
70 | + 'Applications\Mail\Confirmation' => __DIR__.'/Applications/Mail/Confirmation.php', |
|
71 | + 'Applications\Mail\Forward' => __DIR__.'/Applications/Mail/Forward.php', |
|
72 | + 'Applications\Mail\NewApplication' => __DIR__.'/Applications/Mail/NewApplication.php', |
|
73 | + 'Applications\Mail\StatusChange' => __DIR__.'/Applications/Mail/StatusChange.php', |
|
74 | + 'Applications\Mail\StatusChangeInterface' => __DIR__.'/Applications/Mail/StatusChangeInterface.php', |
|
75 | + 'Applications\Options\ModuleOptions' => __DIR__.'/Applications/Options/ModuleOptions.php', |
|
76 | + 'Applications\Paginator\JobSelectPaginator' => __DIR__.'/Applications/Paginator/JobSelectPaginator.php', |
|
77 | + 'Applications\Repository\Application' => __DIR__.'/Applications/Repository/Application.php', |
|
78 | + 'Applications\Repository\Event\DeleteRemovedAttachmentsSubscriber' => __DIR__.'/Applications/Repository/Event/DeleteRemovedAttachmentsSubscriber.php', |
|
79 | + 'Applications\Repository\Event\JobReferencesUpdateListener' => __DIR__.'/Applications/Repository/Event/JobReferencesUpdateListener.php', |
|
80 | + 'Applications\Repository\Event\UpdateFilesPermissionsSubscriber' => __DIR__.'/Applications/Repository/Event/UpdateFilesPermissionsSubscriber.php', |
|
81 | + 'Applications\Repository\Event\UpdatePermissionsSubscriber' => __DIR__.'/Applications/Repository/Event/UpdatePermissionsSubscriber.php', |
|
82 | + 'Applications\Repository\Filter\PaginationQuery' => __DIR__.'/Applications/Repository/Filter/PaginationQuery.php', |
|
83 | + 'Applications\Repository\Filter\PaginationQueryFactory' => __DIR__.'/Applications/Repository/Filter/PaginationQueryFactory.php', |
|
84 | + 'Applications\Repository\PaginationList' => __DIR__.'/Applications/Repository/PaginationList.php', |
|
85 | + 'Applications\Repository\Subscriber' => __DIR__.'/Applications/Repository/Subscriber.php', |
|
86 | 86 | ); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | return $this; |
88 | 88 | } |
89 | 89 | |
90 | - public function getUsername(){ |
|
90 | + public function getUsername() { |
|
91 | 91 | return $this->connectionConfig['username']; |
92 | 92 | } |
93 | 93 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | return $this; |
99 | 99 | } |
100 | 100 | |
101 | - public function getPassword(){ |
|
101 | + public function getPassword() { |
|
102 | 102 | return $this->connectionConfig['password']; |
103 | 103 | } |
104 | 104 | |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | return $this; |
110 | 110 | } |
111 | 111 | |
112 | - public function getSsl(){ |
|
112 | + public function getSsl() { |
|
113 | 113 | return $this->connectionConfig['ssl']; |
114 | 114 | } |
115 | 115 | |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | return $this; |
119 | 119 | } |
120 | 120 | |
121 | - public function getTransportClass(){ |
|
121 | + public function getTransportClass() { |
|
122 | 122 | return $this->transportClass; |
123 | 123 | } |
124 | 124 | } |
125 | 125 | \ No newline at end of file |
@@ -50,8 +50,8 @@ |
||
50 | 50 | $jsonLdProvider = new JsonLdProvider($job); |
51 | 51 | |
52 | 52 | return '<script type="application/ld+json">' |
53 | - . $jsonLdProvider->toJsonLd() |
|
54 | - . '</script>'; |
|
53 | + . $jsonLdProvider->toJsonLd() |
|
54 | + . '</script>'; |
|
55 | 55 | |
56 | 56 | } |
57 | 57 |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $dateStart = $this->job->getDatePublishStart(); |
53 | 53 | $dateStart = $dateStart ? $dateStart->format('Y-m-d') : null; |
54 | 54 | |
55 | - $array=[ |
|
55 | + $array = [ |
|
56 | 56 | '@context'=>'http://schema.org/', |
57 | 57 | '@type' => 'JobPosting', |
58 | 58 | 'title' => $this->job->getTitle(), |
@@ -84,9 +84,9 @@ discard block |
||
84 | 84 | * |
85 | 85 | * @return array |
86 | 86 | */ |
87 | - private function getLocations($locations){ |
|
88 | - $array=[]; |
|
89 | - foreach($locations as $location){ /* @var \Core\Entity\LocationInterface $location */ |
|
87 | + private function getLocations($locations) { |
|
88 | + $array = []; |
|
89 | + foreach ($locations as $location) { /* @var \Core\Entity\LocationInterface $location */ |
|
90 | 90 | array_push( |
91 | 91 | $array, |
92 | 92 | [ |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | private function getDescription(TemplateValuesInterface $values) { |
114 | 114 | |
115 | - $description=sprintf( |
|
115 | + $description = sprintf( |
|
116 | 116 | "<p>%s</p>". |
117 | 117 | "<h1>%s</h1>". |
118 | 118 | "<h3>Requirements</h3><p>%s</p>". |
@@ -54,6 +54,7 @@ |
||
54 | 54 | * ManageController constructor. |
55 | 55 | * |
56 | 56 | * @param RepositoryService $repositories |
57 | + * @param ContainerInterface $container |
|
57 | 58 | */ |
58 | 59 | public function __construct( |
59 | 60 | RepositoryService $repositories, |
@@ -30,70 +30,70 @@ discard block |
||
30 | 30 | */ |
31 | 31 | class ManageController extends AbstractActionController |
32 | 32 | { |
33 | - /** |
|
34 | - * @var RepositoryService |
|
35 | - */ |
|
36 | - private $repositories; |
|
33 | + /** |
|
34 | + * @var RepositoryService |
|
35 | + */ |
|
36 | + private $repositories; |
|
37 | 37 | |
38 | - /** |
|
39 | - * @var |
|
40 | - */ |
|
41 | - private $coreNavigation; |
|
38 | + /** |
|
39 | + * @var |
|
40 | + */ |
|
41 | + private $coreNavigation; |
|
42 | 42 | |
43 | - private $forms; |
|
43 | + private $forms; |
|
44 | 44 | |
45 | - private $appOptions; |
|
45 | + private $appOptions; |
|
46 | 46 | |
47 | - private $appEvents; |
|
47 | + private $appEvents; |
|
48 | 48 | |
49 | - private $translator; |
|
49 | + private $translator; |
|
50 | 50 | |
51 | - private $container; |
|
51 | + private $container; |
|
52 | 52 | |
53 | - /** |
|
54 | - * ManageController constructor. |
|
55 | - * |
|
56 | - * @param RepositoryService $repositories |
|
57 | - */ |
|
58 | - public function __construct( |
|
59 | - RepositoryService $repositories, |
|
60 | - $coreNavigation, |
|
61 | - $forms, |
|
62 | - $appOptions, |
|
63 | - $appEvents, |
|
64 | - $translator, |
|
65 | - $container |
|
66 | - ) |
|
67 | - { |
|
68 | - $this->repositories = $repositories; |
|
69 | - $this->coreNavigation = $coreNavigation; |
|
70 | - $this->forms = $forms; |
|
71 | - $this->appOptions = $appOptions; |
|
72 | - $this->appEvents = $appEvents; |
|
73 | - $this->translator = $translator; |
|
74 | - $this->container = $container; |
|
75 | - } |
|
53 | + /** |
|
54 | + * ManageController constructor. |
|
55 | + * |
|
56 | + * @param RepositoryService $repositories |
|
57 | + */ |
|
58 | + public function __construct( |
|
59 | + RepositoryService $repositories, |
|
60 | + $coreNavigation, |
|
61 | + $forms, |
|
62 | + $appOptions, |
|
63 | + $appEvents, |
|
64 | + $translator, |
|
65 | + $container |
|
66 | + ) |
|
67 | + { |
|
68 | + $this->repositories = $repositories; |
|
69 | + $this->coreNavigation = $coreNavigation; |
|
70 | + $this->forms = $forms; |
|
71 | + $this->appOptions = $appOptions; |
|
72 | + $this->appEvents = $appEvents; |
|
73 | + $this->translator = $translator; |
|
74 | + $this->container = $container; |
|
75 | + } |
|
76 | 76 | |
77 | - /** |
|
78 | - * @param ContainerInterface $container |
|
79 | - * |
|
80 | - * @return ManageController |
|
81 | - */ |
|
82 | - static public function factory(ContainerInterface $container) |
|
83 | - { |
|
84 | - $ob = new self( |
|
85 | - $container->get('Core/RepositoryService'), |
|
86 | - $container->get('Core/Navigation'), |
|
87 | - $container->get('forms'), |
|
88 | - $container->get('Applications/Options'), |
|
89 | - $container->get('Applications/Events'), |
|
90 | - $container->get('translator'), |
|
91 | - $container |
|
92 | - ); |
|
93 | - return $ob; |
|
94 | - } |
|
77 | + /** |
|
78 | + * @param ContainerInterface $container |
|
79 | + * |
|
80 | + * @return ManageController |
|
81 | + */ |
|
82 | + static public function factory(ContainerInterface $container) |
|
83 | + { |
|
84 | + $ob = new self( |
|
85 | + $container->get('Core/RepositoryService'), |
|
86 | + $container->get('Core/Navigation'), |
|
87 | + $container->get('forms'), |
|
88 | + $container->get('Applications/Options'), |
|
89 | + $container->get('Applications/Events'), |
|
90 | + $container->get('translator'), |
|
91 | + $container |
|
92 | + ); |
|
93 | + return $ob; |
|
94 | + } |
|
95 | 95 | |
96 | - /** |
|
96 | + /** |
|
97 | 97 | * (non-PHPdoc) |
98 | 98 | * @see \Zend\Mvc\Controller\AbstractActionController::onDispatch() |
99 | 99 | */ |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | $application->changeStatus( |
165 | 165 | $application->getStatus(), |
166 | 166 | sprintf(/*@translate*/ 'Application was read by %s', |
167 | - $this->auth()->getUser()->getInfo()->getDisplayName())); |
|
167 | + $this->auth()->getUser()->getInfo()->getDisplayName())); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | |
@@ -191,15 +191,15 @@ discard block |
||
191 | 191 | $viewModel->setVariables( |
192 | 192 | /*array( |
193 | 193 | 'application' => */$this->builders |
194 | - ->get('JsonApplication') |
|
195 | - ->unbuild($application) |
|
194 | + ->get('JsonApplication') |
|
195 | + ->unbuild($application) |
|
196 | 196 | ); |
197 | 197 | $viewModel->setVariable('isUnread', $applicationIsUnread); |
198 | 198 | $return = $viewModel; |
199 | 199 | break; |
200 | 200 | case 'pdf': |
201 | - // @TODO: [ZF3] Refactor this so we can inject Core/Html2Pdf service during controller creation |
|
202 | - $pdf = $this->container->get('Core/Html2Pdf'); |
|
201 | + // @TODO: [ZF3] Refactor this so we can inject Core/Html2Pdf service during controller creation |
|
202 | + $pdf = $this->container->get('Core/Html2Pdf'); |
|
203 | 203 | $return['format'] = $format; |
204 | 204 | break; |
205 | 205 | default: |
@@ -356,12 +356,12 @@ discard block |
||
356 | 356 | |
357 | 357 | /* @var ApplicationEvent $event */ |
358 | 358 | $event = $events->getEvent(ApplicationEvent::EVENT_APPLICATION_STATUS_CHANGE, |
359 | - $this, |
|
360 | - [ |
|
361 | - 'application' => $application, |
|
362 | - 'status' => $status, |
|
363 | - 'user' => $this->auth()->getUser(), |
|
364 | - ] |
|
359 | + $this, |
|
360 | + [ |
|
361 | + 'application' => $application, |
|
362 | + 'status' => $status, |
|
363 | + 'user' => $this->auth()->getUser(), |
|
364 | + ] |
|
365 | 365 | ); |
366 | 366 | |
367 | 367 | $event->setIsPostRequest($request->isPost()); |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | $emailAddress = $this->params()->fromQuery('email'); |
412 | 412 | /* @var \Applications\Entity\Application $application */ |
413 | 413 | $application = $this->repositories->get('Applications/Application') |
414 | - ->find($this->params('id')); |
|
414 | + ->find($this->params('id')); |
|
415 | 415 | |
416 | 416 | $this->acl($application, 'forward'); |
417 | 417 |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $this->appOptions = $appOptions; |
72 | 72 | $this->appEvents = $appEvents; |
73 | 73 | $this->translator = $translator; |
74 | - $this->container = $container; |
|
74 | + $this->container = $container; |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | |
170 | 170 | |
171 | 171 | |
172 | - $format=$this->params()->fromQuery('format'); |
|
172 | + $format = $this->params()->fromQuery('format'); |
|
173 | 173 | |
174 | 174 | if ($application->isDraft()) { |
175 | 175 | $list = false; |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | && ($network = $this->params()->fromQuery('network')) |
298 | 298 | && ($data = $this->params()->fromPost('data')) |
299 | 299 | ) { |
300 | - $profileClass = '\\Auth\\Entity\\SocialProfiles\\' . $network; |
|
300 | + $profileClass = '\\Auth\\Entity\\SocialProfiles\\'.$network; |
|
301 | 301 | $profile = new $profileClass(); |
302 | 302 | $profile->setData(\Zend\Json\Json::decode($data, \Zend\Json\Json::TYPE_ARRAY)); |
303 | 303 | } else { |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | |
367 | 367 | $event->setIsPostRequest($request->isPost()); |
368 | 368 | $event->setPostData($request->getPost()); |
369 | - $events->trigger($event->getName(),$event); |
|
369 | + $events->trigger($event->getName(), $event); |
|
370 | 370 | |
371 | 371 | $params = $event->getFormData(); |
372 | 372 | |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | |
416 | 416 | $this->acl($application, 'forward'); |
417 | 417 | |
418 | - $translator = $this->translator; |
|
418 | + $translator = $this->translator; |
|
419 | 419 | |
420 | 420 | if (!$emailAddress) { |
421 | 421 | throw new \InvalidArgumentException('An email address must be supplied.'); |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | public function deleteAction() |
456 | 456 | { |
457 | 457 | $id = $this->params('id'); |
458 | - $repositories= $this->repositories; |
|
458 | + $repositories = $this->repositories; |
|
459 | 459 | $repository = $repositories->get('Applications/Application'); |
460 | 460 | $application = $repository->find($id); |
461 | 461 | |
@@ -465,8 +465,8 @@ discard block |
||
465 | 465 | |
466 | 466 | $this->acl($application, 'delete'); |
467 | 467 | |
468 | - $events = $this->appEvents; |
|
469 | - $events->trigger(ApplicationEvent::EVENT_APPLICATION_PRE_DELETE, $this, [ 'application' => $application ]); |
|
468 | + $events = $this->appEvents; |
|
469 | + $events->trigger(ApplicationEvent::EVENT_APPLICATION_PRE_DELETE, $this, ['application' => $application]); |
|
470 | 470 | |
471 | 471 | $repositories->remove($application); |
472 | 472 |
@@ -25,7 +25,7 @@ |
||
25 | 25 | * @param string $requestedName |
26 | 26 | * @param null|array $options |
27 | 27 | * |
28 | - * @return object |
|
28 | + * @return RegisterConfirmation |
|
29 | 29 | * @throws ServiceNotFoundException if unable to resolve the service. |
30 | 30 | * @throws ServiceNotCreatedException if an exception is raised when |
31 | 31 | * creating a service. |
@@ -24,7 +24,7 @@ |
||
24 | 24 | * @param string $requestedName |
25 | 25 | * @param null|array $options |
26 | 26 | * |
27 | - * @return object |
|
27 | + * @return UserUniqueTokenGenerator |
|
28 | 28 | * @throws ServiceNotFoundException if unable to resolve the service. |
29 | 29 | * @throws ServiceNotCreatedException if an exception is raised when |
30 | 30 | * creating a service. |
@@ -31,6 +31,7 @@ discard block |
||
31 | 31 | * |
32 | 32 | * @When /^(?:|I )fill in select2 "(?P<field>(?:[^"]|\\")*)" with "(?P<value>(?:[^"]|\\")*)"$/ |
33 | 33 | * @When /^(?:|I )fill in select2 "(?P<value>(?:[^"]|\\")*)" for "(?P<field>(?:[^"]|\\")*)"$/ |
34 | + * @param string $field |
|
34 | 35 | */ |
35 | 36 | public function iFillInSelect2Field($field, $value) |
36 | 37 | { |
@@ -42,7 +43,7 @@ discard block |
||
42 | 43 | |
43 | 44 | /** |
44 | 45 | * @When I fill in select2 search :field with :search and I choose :choice |
45 | - * @param $field |
|
46 | + * @param string $field |
|
46 | 47 | * @param $value |
47 | 48 | */ |
48 | 49 | public function iFillInSelect2FieldWith($field,$search,$choice=null) |
@@ -24,130 +24,130 @@ |
||
24 | 24 | */ |
25 | 25 | class Select2Context extends RawMinkContext implements Context |
26 | 26 | { |
27 | - protected $timeout = 5; |
|
27 | + protected $timeout = 5; |
|
28 | 28 | |
29 | - /** |
|
30 | - * Fills in Select2 field with specified |
|
31 | - * |
|
32 | - * @When /^(?:|I )fill in select2 "(?P<field>(?:[^"]|\\")*)" with "(?P<value>(?:[^"]|\\")*)"$/ |
|
33 | - * @When /^(?:|I )fill in select2 "(?P<value>(?:[^"]|\\")*)" for "(?P<field>(?:[^"]|\\")*)"$/ |
|
34 | - */ |
|
35 | - public function iFillInSelect2Field($field, $value) |
|
36 | - { |
|
37 | - $page = $this->getSession()->getPage(); |
|
29 | + /** |
|
30 | + * Fills in Select2 field with specified |
|
31 | + * |
|
32 | + * @When /^(?:|I )fill in select2 "(?P<field>(?:[^"]|\\")*)" with "(?P<value>(?:[^"]|\\")*)"$/ |
|
33 | + * @When /^(?:|I )fill in select2 "(?P<value>(?:[^"]|\\")*)" for "(?P<field>(?:[^"]|\\")*)"$/ |
|
34 | + */ |
|
35 | + public function iFillInSelect2Field($field, $value) |
|
36 | + { |
|
37 | + $page = $this->getSession()->getPage(); |
|
38 | 38 | |
39 | - $this->openField($page, $field); |
|
40 | - $this->selectValue($page, $field, $value, $this->timeout); |
|
41 | - } |
|
39 | + $this->openField($page, $field); |
|
40 | + $this->selectValue($page, $field, $value, $this->timeout); |
|
41 | + } |
|
42 | 42 | |
43 | - /** |
|
44 | - * @When I fill in select2 search :field with :search and I choose :choice |
|
45 | - * @param $field |
|
46 | - * @param $value |
|
47 | - */ |
|
48 | - public function iFillInSelect2FieldWith($field,$search,$choice=null) |
|
49 | - { |
|
50 | - $page = $this->getSession()->getPage(); |
|
51 | - $this->openField($page, $field); |
|
52 | - $this->fillSearchField($page,$field,$search); |
|
53 | - $this->selectValue($page, $field, $choice); |
|
54 | - } |
|
43 | + /** |
|
44 | + * @When I fill in select2 search :field with :search and I choose :choice |
|
45 | + * @param $field |
|
46 | + * @param $value |
|
47 | + */ |
|
48 | + public function iFillInSelect2FieldWith($field,$search,$choice=null) |
|
49 | + { |
|
50 | + $page = $this->getSession()->getPage(); |
|
51 | + $this->openField($page, $field); |
|
52 | + $this->fillSearchField($page,$field,$search); |
|
53 | + $this->selectValue($page, $field, $choice); |
|
54 | + } |
|
55 | 55 | |
56 | - /** |
|
57 | - * Fill Select2 search field |
|
58 | - * |
|
59 | - * @param DocumentElement $page |
|
60 | - * @param string $field |
|
61 | - * @param string $value |
|
62 | - * @throws \Exception |
|
63 | - */ |
|
64 | - private function fillSearchField(DocumentElement $page, $field, $value) |
|
65 | - { |
|
66 | - $driver = $this->getSession()->getDriver(); |
|
67 | - if ('Behat\Mink\Driver\Selenium2Driver' === get_class($driver)) { |
|
68 | - // Can't use `$this->getSession()->getPage()->find()` because of https://github.com/minkphp/MinkSelenium2Driver/issues/188 |
|
56 | + /** |
|
57 | + * Fill Select2 search field |
|
58 | + * |
|
59 | + * @param DocumentElement $page |
|
60 | + * @param string $field |
|
61 | + * @param string $value |
|
62 | + * @throws \Exception |
|
63 | + */ |
|
64 | + private function fillSearchField(DocumentElement $page, $field, $value) |
|
65 | + { |
|
66 | + $driver = $this->getSession()->getDriver(); |
|
67 | + if ('Behat\Mink\Driver\Selenium2Driver' === get_class($driver)) { |
|
68 | + // Can't use `$this->getSession()->getPage()->find()` because of https://github.com/minkphp/MinkSelenium2Driver/issues/188 |
|
69 | 69 | |
70 | - $element = $page->find('css','.select2-container--open .select2-search__field'); |
|
71 | - $xpath = $element->getXpath(); |
|
72 | - $select2Input = $this->getSession() |
|
73 | - ->getDriver() |
|
74 | - ->getWebDriverSession() |
|
75 | - ->element('xpath',$xpath) |
|
76 | - //->element('xpath', "//html/descendant-or-self::*[@class and contains(concat(' ', normalize-space(@class), ' '), ' select2-search__field ')]") |
|
77 | - ; |
|
78 | - if (!$select2Input) { |
|
79 | - throw new \Exception(sprintf('No field "%s" found', $field)); |
|
80 | - } |
|
70 | + $element = $page->find('css','.select2-container--open .select2-search__field'); |
|
71 | + $xpath = $element->getXpath(); |
|
72 | + $select2Input = $this->getSession() |
|
73 | + ->getDriver() |
|
74 | + ->getWebDriverSession() |
|
75 | + ->element('xpath',$xpath) |
|
76 | + //->element('xpath', "//html/descendant-or-self::*[@class and contains(concat(' ', normalize-space(@class), ' '), ' select2-search__field ')]") |
|
77 | + ; |
|
78 | + if (!$select2Input) { |
|
79 | + throw new \Exception(sprintf('No field "%s" found', $field)); |
|
80 | + } |
|
81 | 81 | |
82 | - $select2Input->postValue(['value' => [$value]]); |
|
83 | - } else { |
|
84 | - $select2Input = $page->find('css', '.select2-search__field'); |
|
85 | - if (!$select2Input) { |
|
86 | - throw new \Exception(sprintf('No input found for "%s"', $field)); |
|
87 | - } |
|
88 | - $select2Input->setValue($value); |
|
89 | - } |
|
82 | + $select2Input->postValue(['value' => [$value]]); |
|
83 | + } else { |
|
84 | + $select2Input = $page->find('css', '.select2-search__field'); |
|
85 | + if (!$select2Input) { |
|
86 | + throw new \Exception(sprintf('No input found for "%s"', $field)); |
|
87 | + } |
|
88 | + $select2Input->setValue($value); |
|
89 | + } |
|
90 | 90 | |
91 | - $this->waitForLoadingResults($this->timeout); |
|
92 | - } |
|
91 | + $this->waitForLoadingResults($this->timeout); |
|
92 | + } |
|
93 | 93 | |
94 | - /** |
|
95 | - * Select value in choice list |
|
96 | - * |
|
97 | - * @param DocumentElement $page |
|
98 | - * @param string $field |
|
99 | - * @param string $value |
|
100 | - * @param int $time |
|
101 | - * @throws \Exception |
|
102 | - */ |
|
103 | - private function selectValue(DocumentElement $page, $field, $value, $time=5) |
|
104 | - { |
|
105 | - $this->waitForLoadingResults($time); |
|
94 | + /** |
|
95 | + * Select value in choice list |
|
96 | + * |
|
97 | + * @param DocumentElement $page |
|
98 | + * @param string $field |
|
99 | + * @param string $value |
|
100 | + * @param int $time |
|
101 | + * @throws \Exception |
|
102 | + */ |
|
103 | + private function selectValue(DocumentElement $page, $field, $value, $time=5) |
|
104 | + { |
|
105 | + $this->waitForLoadingResults($time); |
|
106 | 106 | |
107 | - $chosenResults = $page->findAll('css', '.select2-results li'); |
|
108 | - foreach ($chosenResults as $result) { |
|
109 | - $text = $result->getText(); |
|
110 | - if (false!==strpos($text,$value)) { |
|
111 | - $result->click(); |
|
112 | - return; |
|
113 | - } |
|
114 | - } |
|
107 | + $chosenResults = $page->findAll('css', '.select2-results li'); |
|
108 | + foreach ($chosenResults as $result) { |
|
109 | + $text = $result->getText(); |
|
110 | + if (false!==strpos($text,$value)) { |
|
111 | + $result->click(); |
|
112 | + return; |
|
113 | + } |
|
114 | + } |
|
115 | 115 | |
116 | - throw new \Exception(sprintf('Value "%s" not found for "%s"', $value, $field)); |
|
117 | - } |
|
116 | + throw new \Exception(sprintf('Value "%s" not found for "%s"', $value, $field)); |
|
117 | + } |
|
118 | 118 | |
119 | - private function openField(DocumentElement $page, $field) |
|
120 | - { |
|
121 | - $inputField = $page->find('css',$field); |
|
122 | - if(!$inputField){ |
|
123 | - $fieldName = sprintf('select[name="%s"] + .select2-container', $field); |
|
124 | - $inputField = $page->find('css', $fieldName); |
|
125 | - } |
|
126 | - if (!$inputField) { |
|
127 | - throw new \Exception(sprintf('No field "%s" found', $field)); |
|
128 | - } |
|
119 | + private function openField(DocumentElement $page, $field) |
|
120 | + { |
|
121 | + $inputField = $page->find('css',$field); |
|
122 | + if(!$inputField){ |
|
123 | + $fieldName = sprintf('select[name="%s"] + .select2-container', $field); |
|
124 | + $inputField = $page->find('css', $fieldName); |
|
125 | + } |
|
126 | + if (!$inputField) { |
|
127 | + throw new \Exception(sprintf('No field "%s" found', $field)); |
|
128 | + } |
|
129 | 129 | |
130 | - $choice = $inputField->find('css', '.select2-selection'); |
|
131 | - if (!$choice) { |
|
132 | - throw new \Exception(sprintf('No select2 choice found for "%s"', $field)); |
|
133 | - } |
|
134 | - $choice->press(); |
|
135 | - } |
|
130 | + $choice = $inputField->find('css', '.select2-selection'); |
|
131 | + if (!$choice) { |
|
132 | + throw new \Exception(sprintf('No select2 choice found for "%s"', $field)); |
|
133 | + } |
|
134 | + $choice->press(); |
|
135 | + } |
|
136 | 136 | |
137 | - /** |
|
138 | - * Wait the end of fetching Select2 results |
|
139 | - * |
|
140 | - * @param int $time Time to wait in seconds |
|
141 | - */ |
|
142 | - private function waitForLoadingResults($time) |
|
143 | - { |
|
144 | - for ($i = 0; $i < $time; $i++) { |
|
145 | - if (!$this->getSession()->getPage()->find('css', '.select2-results__option.loading-results')) { |
|
146 | - return; |
|
147 | - } |
|
137 | + /** |
|
138 | + * Wait the end of fetching Select2 results |
|
139 | + * |
|
140 | + * @param int $time Time to wait in seconds |
|
141 | + */ |
|
142 | + private function waitForLoadingResults($time) |
|
143 | + { |
|
144 | + for ($i = 0; $i < $time; $i++) { |
|
145 | + if (!$this->getSession()->getPage()->find('css', '.select2-results__option.loading-results')) { |
|
146 | + return; |
|
147 | + } |
|
148 | 148 | |
149 | - sleep(1); |
|
150 | - } |
|
151 | - } |
|
149 | + sleep(1); |
|
150 | + } |
|
151 | + } |
|
152 | 152 | |
153 | 153 | } |
154 | 154 | \ No newline at end of file |
@@ -45,11 +45,11 @@ discard block |
||
45 | 45 | * @param $field |
46 | 46 | * @param $value |
47 | 47 | */ |
48 | - public function iFillInSelect2FieldWith($field,$search,$choice=null) |
|
48 | + public function iFillInSelect2FieldWith($field, $search, $choice = null) |
|
49 | 49 | { |
50 | 50 | $page = $this->getSession()->getPage(); |
51 | 51 | $this->openField($page, $field); |
52 | - $this->fillSearchField($page,$field,$search); |
|
52 | + $this->fillSearchField($page, $field, $search); |
|
53 | 53 | $this->selectValue($page, $field, $choice); |
54 | 54 | } |
55 | 55 | |
@@ -67,12 +67,12 @@ discard block |
||
67 | 67 | if ('Behat\Mink\Driver\Selenium2Driver' === get_class($driver)) { |
68 | 68 | // Can't use `$this->getSession()->getPage()->find()` because of https://github.com/minkphp/MinkSelenium2Driver/issues/188 |
69 | 69 | |
70 | - $element = $page->find('css','.select2-container--open .select2-search__field'); |
|
70 | + $element = $page->find('css', '.select2-container--open .select2-search__field'); |
|
71 | 71 | $xpath = $element->getXpath(); |
72 | 72 | $select2Input = $this->getSession() |
73 | 73 | ->getDriver() |
74 | 74 | ->getWebDriverSession() |
75 | - ->element('xpath',$xpath) |
|
75 | + ->element('xpath', $xpath) |
|
76 | 76 | //->element('xpath', "//html/descendant-or-self::*[@class and contains(concat(' ', normalize-space(@class), ' '), ' select2-search__field ')]") |
77 | 77 | ; |
78 | 78 | if (!$select2Input) { |
@@ -100,14 +100,14 @@ discard block |
||
100 | 100 | * @param int $time |
101 | 101 | * @throws \Exception |
102 | 102 | */ |
103 | - private function selectValue(DocumentElement $page, $field, $value, $time=5) |
|
103 | + private function selectValue(DocumentElement $page, $field, $value, $time = 5) |
|
104 | 104 | { |
105 | 105 | $this->waitForLoadingResults($time); |
106 | 106 | |
107 | 107 | $chosenResults = $page->findAll('css', '.select2-results li'); |
108 | 108 | foreach ($chosenResults as $result) { |
109 | 109 | $text = $result->getText(); |
110 | - if (false!==strpos($text,$value)) { |
|
110 | + if (false !== strpos($text, $value)) { |
|
111 | 111 | $result->click(); |
112 | 112 | return; |
113 | 113 | } |
@@ -118,8 +118,8 @@ discard block |
||
118 | 118 | |
119 | 119 | private function openField(DocumentElement $page, $field) |
120 | 120 | { |
121 | - $inputField = $page->find('css',$field); |
|
122 | - if(!$inputField){ |
|
121 | + $inputField = $page->find('css', $field); |
|
122 | + if (!$inputField) { |
|
123 | 123 | $fieldName = sprintf('select[name="%s"] + .select2-container', $field); |
124 | 124 | $inputField = $page->find('css', $fieldName); |
125 | 125 | } |
@@ -198,6 +198,9 @@ discard block |
||
198 | 198 | $this->startLogin($user,'test'); |
199 | 199 | } |
200 | 200 | |
201 | + /** |
|
202 | + * @param string $password |
|
203 | + */ |
|
201 | 204 | private function startLogin(UserInterface $user, $password) |
202 | 205 | { |
203 | 206 | $currentUser = $this->currentUser; |
@@ -242,7 +245,7 @@ discard block |
||
242 | 245 | * @param string $fullname |
243 | 246 | * @param string $role |
244 | 247 | * |
245 | - * @return \Auth\Entity\UserInterface |
|
248 | + * @return \Core\Entity\EntityInterface |
|
246 | 249 | */ |
247 | 250 | public function createUser($email,$password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter") |
248 | 251 | { |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | try{ |
98 | 98 | JobContext::removeJobByUser($user); |
99 | 99 | $repo->remove($user,true); |
100 | - }catch (\Exception $e){ |
|
100 | + } catch (\Exception $e){ |
|
101 | 101 | |
102 | 102 | } |
103 | 103 | } |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | $organization->setOrganizationName($organizationName); |
298 | 298 | $permissions = $organization->getPermissions(); |
299 | 299 | $permissions->grant($user,Permissions::PERMISSION_ALL); |
300 | - }else { |
|
300 | + } else { |
|
301 | 301 | $organization->getPermissions()->grant($user,Permissions::PERMISSION_ALL); |
302 | 302 | } |
303 | 303 | $organization->setUser($user); |
@@ -37,384 +37,384 @@ |
||
37 | 37 | { |
38 | 38 | use CommonContextTrait; |
39 | 39 | |
40 | - /** |
|
41 | - * @var User[] |
|
42 | - */ |
|
43 | - static private $users = []; |
|
40 | + /** |
|
41 | + * @var User[] |
|
42 | + */ |
|
43 | + static private $users = []; |
|
44 | 44 | |
45 | - /** |
|
46 | - * @var UserRepository |
|
47 | - */ |
|
48 | - static private $userRepo; |
|
45 | + /** |
|
46 | + * @var UserRepository |
|
47 | + */ |
|
48 | + static private $userRepo; |
|
49 | 49 | |
50 | - /** |
|
51 | - * @var string |
|
52 | - */ |
|
53 | - static private $currentSession; |
|
50 | + /** |
|
51 | + * @var string |
|
52 | + */ |
|
53 | + static private $currentSession; |
|
54 | 54 | |
55 | - private $socialLoginInfo = []; |
|
55 | + private $socialLoginInfo = []; |
|
56 | 56 | |
57 | - /** |
|
58 | - * @var UserInterface |
|
59 | - */ |
|
60 | - private $loggedInUser; |
|
57 | + /** |
|
58 | + * @var UserInterface |
|
59 | + */ |
|
60 | + private $loggedInUser; |
|
61 | 61 | |
62 | 62 | /** |
63 | 63 | * @var User |
64 | 64 | */ |
65 | 65 | protected $currentUser; |
66 | 66 | |
67 | - public function __construct($parameters=[]) |
|
68 | - { |
|
69 | - $defaultLoginInfo = [ |
|
70 | - 'facebook' => [ |
|
71 | - 'email' => getenv('FACEBOOK_USER_EMAIL'), |
|
72 | - 'pass' => getenv('FACEBOOK_USER_PASSWORD') |
|
73 | - ], |
|
74 | - 'linkedin' => [ |
|
75 | - 'session_key-login' => getenv('LINKEDIN_USER_EMAIL'), |
|
76 | - 'session_password-login' => getenv('LINKEDIN_USER_PASSWORD') |
|
77 | - ], |
|
78 | - ]; |
|
79 | - $socialLoginConfig = isset($parameters['social_login_info']) ? $parameters['social_login_info']:[]; |
|
80 | - $this->socialLoginInfo = array_merge($defaultLoginInfo,$socialLoginConfig); |
|
81 | - } |
|
67 | + public function __construct($parameters=[]) |
|
68 | + { |
|
69 | + $defaultLoginInfo = [ |
|
70 | + 'facebook' => [ |
|
71 | + 'email' => getenv('FACEBOOK_USER_EMAIL'), |
|
72 | + 'pass' => getenv('FACEBOOK_USER_PASSWORD') |
|
73 | + ], |
|
74 | + 'linkedin' => [ |
|
75 | + 'session_key-login' => getenv('LINKEDIN_USER_EMAIL'), |
|
76 | + 'session_password-login' => getenv('LINKEDIN_USER_PASSWORD') |
|
77 | + ], |
|
78 | + ]; |
|
79 | + $socialLoginConfig = isset($parameters['social_login_info']) ? $parameters['social_login_info']:[]; |
|
80 | + $this->socialLoginInfo = array_merge($defaultLoginInfo,$socialLoginConfig); |
|
81 | + } |
|
82 | 82 | |
83 | - /** |
|
84 | - * @AfterSuite |
|
85 | - * @param AfterSuiteScope $scope |
|
86 | - */ |
|
87 | - static public function afterSuite(AfterSuiteScope $scope) |
|
88 | - { |
|
89 | - $repo = static::$userRepo; |
|
90 | - foreach(static::$users as $user){ |
|
91 | - if($repo->findByLogin($user->getLogin())){ |
|
92 | - try{ |
|
93 | - JobContext::removeJobByUser($user); |
|
94 | - $repo->remove($user,true); |
|
95 | - }catch (\Exception $e){ |
|
83 | + /** |
|
84 | + * @AfterSuite |
|
85 | + * @param AfterSuiteScope $scope |
|
86 | + */ |
|
87 | + static public function afterSuite(AfterSuiteScope $scope) |
|
88 | + { |
|
89 | + $repo = static::$userRepo; |
|
90 | + foreach(static::$users as $user){ |
|
91 | + if($repo->findByLogin($user->getLogin())){ |
|
92 | + try{ |
|
93 | + JobContext::removeJobByUser($user); |
|
94 | + $repo->remove($user,true); |
|
95 | + }catch (\Exception $e){ |
|
96 | 96 | |
97 | - } |
|
98 | - } |
|
99 | - } |
|
100 | - } |
|
97 | + } |
|
98 | + } |
|
99 | + } |
|
100 | + } |
|
101 | 101 | |
102 | - /** |
|
103 | - * @BeforeScenario |
|
104 | - * @param BeforeScenarioScope $scope |
|
105 | - */ |
|
106 | - public function beforeScenario(BeforeScenarioScope $scope) |
|
107 | - { |
|
108 | - $this->minkContext = $scope->getEnvironment()->getContext(MinkContext::class); |
|
109 | - $this->coreContext = $scope->getEnvironment()->getContext(CoreContext::class); |
|
110 | - static::$userRepo = $this->getUserRepository(); |
|
111 | - } |
|
102 | + /** |
|
103 | + * @BeforeScenario |
|
104 | + * @param BeforeScenarioScope $scope |
|
105 | + */ |
|
106 | + public function beforeScenario(BeforeScenarioScope $scope) |
|
107 | + { |
|
108 | + $this->minkContext = $scope->getEnvironment()->getContext(MinkContext::class); |
|
109 | + $this->coreContext = $scope->getEnvironment()->getContext(CoreContext::class); |
|
110 | + static::$userRepo = $this->getUserRepository(); |
|
111 | + } |
|
112 | 112 | |
113 | - /** |
|
114 | - * @When I fill in login form with :provider user |
|
115 | - */ |
|
116 | - public function iSignInWithSocialUser($provider) |
|
117 | - { |
|
118 | - $provider = strtolower($provider); |
|
119 | - $mink = $this->minkContext; |
|
120 | - foreach($this->socialLoginInfo[$provider] as $field=>$value){ |
|
121 | - $mink->fillField($field,$value); |
|
122 | - } |
|
123 | - } |
|
113 | + /** |
|
114 | + * @When I fill in login form with :provider user |
|
115 | + */ |
|
116 | + public function iSignInWithSocialUser($provider) |
|
117 | + { |
|
118 | + $provider = strtolower($provider); |
|
119 | + $mink = $this->minkContext; |
|
120 | + foreach($this->socialLoginInfo[$provider] as $field=>$value){ |
|
121 | + $mink->fillField($field,$value); |
|
122 | + } |
|
123 | + } |
|
124 | 124 | |
125 | - /** |
|
126 | - * @Given I am logged in as a recruiter |
|
127 | - * @Given I am logged in as a recruiter with :organization as organization |
|
128 | - */ |
|
129 | - public function iAmLoggedInAsARecruiter($organization=null) |
|
130 | - { |
|
131 | - $user = $this->thereIsAUserIdentifiedBy( |
|
132 | - '[email protected]', |
|
133 | - 'test',User::ROLE_RECRUITER, |
|
134 | - 'Test Recruiter', |
|
135 | - $organization |
|
136 | - ); |
|
137 | - $this->startLogin($user,'test'); |
|
138 | - } |
|
125 | + /** |
|
126 | + * @Given I am logged in as a recruiter |
|
127 | + * @Given I am logged in as a recruiter with :organization as organization |
|
128 | + */ |
|
129 | + public function iAmLoggedInAsARecruiter($organization=null) |
|
130 | + { |
|
131 | + $user = $this->thereIsAUserIdentifiedBy( |
|
132 | + '[email protected]', |
|
133 | + 'test',User::ROLE_RECRUITER, |
|
134 | + 'Test Recruiter', |
|
135 | + $organization |
|
136 | + ); |
|
137 | + $this->startLogin($user,'test'); |
|
138 | + } |
|
139 | 139 | |
140 | - /** |
|
141 | - * @Given I don't have :login user |
|
142 | - * @param string $login |
|
143 | - */ |
|
144 | - public function iDonTHaveUser($login) |
|
145 | - { |
|
146 | - $repo = $this->getUserRepository(); |
|
147 | - $user=$repo->findByLogin($login); |
|
148 | - if($user instanceof UserInterface){ |
|
149 | - $repo->remove($user,true); |
|
150 | - } |
|
151 | - } |
|
140 | + /** |
|
141 | + * @Given I don't have :login user |
|
142 | + * @param string $login |
|
143 | + */ |
|
144 | + public function iDonTHaveUser($login) |
|
145 | + { |
|
146 | + $repo = $this->getUserRepository(); |
|
147 | + $user=$repo->findByLogin($login); |
|
148 | + if($user instanceof UserInterface){ |
|
149 | + $repo->remove($user,true); |
|
150 | + } |
|
151 | + } |
|
152 | 152 | |
153 | - /** |
|
154 | - * @Given I have a :role with the following: |
|
155 | - * @param $role |
|
156 | - * @param TableNode $fields |
|
157 | - */ |
|
158 | - public function iHaveUserWithTheFollowing($role,TableNode $fields) |
|
159 | - { |
|
160 | - $normalizedFields = [ |
|
161 | - 'login' => '[email protected]', |
|
162 | - 'fullname' => 'Test Login', |
|
163 | - 'role' => User::ROLE_USER, |
|
164 | - 'password' => 'test', |
|
165 | - 'organization' => 'Cross Solution' |
|
166 | - ]; |
|
167 | - foreach($fields->getRowsHash() as $field=>$value){ |
|
168 | - $field = Inflector::camelize($field); |
|
169 | - $normalizedFields[$field] = $value; |
|
170 | - } |
|
153 | + /** |
|
154 | + * @Given I have a :role with the following: |
|
155 | + * @param $role |
|
156 | + * @param TableNode $fields |
|
157 | + */ |
|
158 | + public function iHaveUserWithTheFollowing($role,TableNode $fields) |
|
159 | + { |
|
160 | + $normalizedFields = [ |
|
161 | + 'login' => '[email protected]', |
|
162 | + 'fullname' => 'Test Login', |
|
163 | + 'role' => User::ROLE_USER, |
|
164 | + 'password' => 'test', |
|
165 | + 'organization' => 'Cross Solution' |
|
166 | + ]; |
|
167 | + foreach($fields->getRowsHash() as $field=>$value){ |
|
168 | + $field = Inflector::camelize($field); |
|
169 | + $normalizedFields[$field] = $value; |
|
170 | + } |
|
171 | 171 | |
172 | - $this->thereIsAUserIdentifiedBy( |
|
173 | - $normalizedFields['login'], |
|
174 | - $normalizedFields['password'], |
|
175 | - $role, |
|
176 | - $normalizedFields['fullname'], |
|
177 | - $normalizedFields['organization'] |
|
178 | - ); |
|
172 | + $this->thereIsAUserIdentifiedBy( |
|
173 | + $normalizedFields['login'], |
|
174 | + $normalizedFields['password'], |
|
175 | + $role, |
|
176 | + $normalizedFields['fullname'], |
|
177 | + $normalizedFields['organization'] |
|
178 | + ); |
|
179 | 179 | |
180 | - } |
|
180 | + } |
|
181 | 181 | |
182 | - /** |
|
183 | - * @Given I am logged in as an administrator |
|
184 | - */ |
|
185 | - public function iAmLoggedInAsAnAdmin() |
|
186 | - { |
|
187 | - $user = $this->thereIsAUserIdentifiedBy('[email protected]','test',User::ROLE_ADMIN); |
|
188 | - $this->startLogin($user,'test'); |
|
189 | - } |
|
182 | + /** |
|
183 | + * @Given I am logged in as an administrator |
|
184 | + */ |
|
185 | + public function iAmLoggedInAsAnAdmin() |
|
186 | + { |
|
187 | + $user = $this->thereIsAUserIdentifiedBy('[email protected]','test',User::ROLE_ADMIN); |
|
188 | + $this->startLogin($user,'test'); |
|
189 | + } |
|
190 | 190 | |
191 | - private function startLogin(UserInterface $user, $password) |
|
192 | - { |
|
193 | - $currentUser = $this->currentUser; |
|
194 | - if(!is_object($currentUser) || $user->getId()!=$currentUser->getId()){ |
|
195 | - $this->iWantToLogIn(); |
|
196 | - $this->iSpecifyTheUsernameAs($user->getLogin()); |
|
197 | - $this->iSpecifyThePasswordAs($password); |
|
198 | - $this->iLogIn(); |
|
199 | - $this->currentUser = $user; |
|
200 | - } |
|
201 | - } |
|
191 | + private function startLogin(UserInterface $user, $password) |
|
192 | + { |
|
193 | + $currentUser = $this->currentUser; |
|
194 | + if(!is_object($currentUser) || $user->getId()!=$currentUser->getId()){ |
|
195 | + $this->iWantToLogIn(); |
|
196 | + $this->iSpecifyTheUsernameAs($user->getLogin()); |
|
197 | + $this->iSpecifyThePasswordAs($password); |
|
198 | + $this->iLogIn(); |
|
199 | + $this->currentUser = $user; |
|
200 | + } |
|
201 | + } |
|
202 | 202 | |
203 | - /** |
|
204 | - * @return UserRepository |
|
205 | - */ |
|
206 | - public function getUserRepository() |
|
207 | - { |
|
208 | - return $this->coreContext->getRepositories()->get('Auth\Entity\User'); |
|
209 | - } |
|
203 | + /** |
|
204 | + * @return UserRepository |
|
205 | + */ |
|
206 | + public function getUserRepository() |
|
207 | + { |
|
208 | + return $this->coreContext->getRepositories()->get('Auth\Entity\User'); |
|
209 | + } |
|
210 | 210 | |
211 | - /** |
|
212 | - * @Given there is a user :email identified by :password |
|
213 | - */ |
|
214 | - public function thereIsAUserIdentifiedBy($email, $password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter",$organization=null) |
|
215 | - { |
|
216 | - $repo = $this->getUserRepository(); |
|
217 | - if(!is_object($user=$repo->findByEmail($email))){ |
|
218 | - $user = $this->createUser($email,$password,$role,$fullname,$organization); |
|
219 | - } |
|
211 | + /** |
|
212 | + * @Given there is a user :email identified by :password |
|
213 | + */ |
|
214 | + public function thereIsAUserIdentifiedBy($email, $password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter",$organization=null) |
|
215 | + { |
|
216 | + $repo = $this->getUserRepository(); |
|
217 | + if(!is_object($user=$repo->findByEmail($email))){ |
|
218 | + $user = $this->createUser($email,$password,$role,$fullname,$organization); |
|
219 | + } |
|
220 | 220 | |
221 | - if(!is_null($organization)){ |
|
222 | - $this->iHaveMainOrganization($user,$organization); |
|
223 | - } |
|
224 | - $this->addCreatedUser($user); |
|
225 | - return $user; |
|
226 | - } |
|
221 | + if(!is_null($organization)){ |
|
222 | + $this->iHaveMainOrganization($user,$organization); |
|
223 | + } |
|
224 | + $this->addCreatedUser($user); |
|
225 | + return $user; |
|
226 | + } |
|
227 | 227 | |
228 | - /** |
|
229 | - * @param $email |
|
230 | - * @param $password |
|
231 | - * @param $username |
|
232 | - * @param string $fullname |
|
233 | - * @param string $role |
|
234 | - * |
|
235 | - * @return \Auth\Entity\UserInterface |
|
236 | - */ |
|
237 | - public function createUser($email,$password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter") |
|
238 | - { |
|
239 | - /* @var Register $service */ |
|
240 | - /* @var User $user */ |
|
241 | - $repo = $this->getUserRepository(); |
|
242 | - $user = $repo->create([]); |
|
243 | - $user->setLogin($email); |
|
244 | - $user->setPassword($password); |
|
245 | - $user->setRole($role); |
|
246 | - $settings = $user->getSettings('Applications'); |
|
228 | + /** |
|
229 | + * @param $email |
|
230 | + * @param $password |
|
231 | + * @param $username |
|
232 | + * @param string $fullname |
|
233 | + * @param string $role |
|
234 | + * |
|
235 | + * @return \Auth\Entity\UserInterface |
|
236 | + */ |
|
237 | + public function createUser($email,$password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter") |
|
238 | + { |
|
239 | + /* @var Register $service */ |
|
240 | + /* @var User $user */ |
|
241 | + $repo = $this->getUserRepository(); |
|
242 | + $user = $repo->create([]); |
|
243 | + $user->setLogin($email); |
|
244 | + $user->setPassword($password); |
|
245 | + $user->setRole($role); |
|
246 | + $settings = $user->getSettings('Applications'); |
|
247 | 247 | |
248 | - $expFullName = explode(' ',$fullname); |
|
249 | - $info = $user->getInfo(); |
|
250 | - $info->setFirstName(array_shift($expFullName)); |
|
251 | - $info->setLastName(count($expFullName)>0 ? implode(' ',$expFullName):''); |
|
252 | - $info->setEmail($email); |
|
253 | - $info->setEmailVerified(true); |
|
254 | - $repo->store($user); |
|
255 | - $repo->getDocumentManager()->refresh($user); |
|
248 | + $expFullName = explode(' ',$fullname); |
|
249 | + $info = $user->getInfo(); |
|
250 | + $info->setFirstName(array_shift($expFullName)); |
|
251 | + $info->setLastName(count($expFullName)>0 ? implode(' ',$expFullName):''); |
|
252 | + $info->setEmail($email); |
|
253 | + $info->setEmailVerified(true); |
|
254 | + $repo->store($user); |
|
255 | + $repo->getDocumentManager()->refresh($user); |
|
256 | 256 | |
257 | - $eventArgs = new LifecycleEventArgs($user, $repo->getDocumentManager()); |
|
258 | - $repo->getDocumentManager()->getEventManager()->dispatchEvent( |
|
259 | - Events::postLoad, |
|
260 | - $eventArgs |
|
261 | - ); |
|
262 | - /* @var \Core\EventManager\EventManager $events */ |
|
263 | - /* @var \Auth\Listener\Events\AuthEvent $event */ |
|
264 | - //@TODO: [Behat] event not working in travis |
|
265 | - //$events = $this->coreContext->getEventManager(); |
|
266 | - //$event = $events->getEvent(AuthEvent::EVENT_USER_REGISTERED, $this); |
|
267 | - //$event->setUser($user); |
|
268 | - //$events->triggerEvent($event); |
|
269 | - return $user; |
|
270 | - } |
|
257 | + $eventArgs = new LifecycleEventArgs($user, $repo->getDocumentManager()); |
|
258 | + $repo->getDocumentManager()->getEventManager()->dispatchEvent( |
|
259 | + Events::postLoad, |
|
260 | + $eventArgs |
|
261 | + ); |
|
262 | + /* @var \Core\EventManager\EventManager $events */ |
|
263 | + /* @var \Auth\Listener\Events\AuthEvent $event */ |
|
264 | + //@TODO: [Behat] event not working in travis |
|
265 | + //$events = $this->coreContext->getEventManager(); |
|
266 | + //$event = $events->getEvent(AuthEvent::EVENT_USER_REGISTERED, $this); |
|
267 | + //$event->setUser($user); |
|
268 | + //$events->triggerEvent($event); |
|
269 | + return $user; |
|
270 | + } |
|
271 | 271 | |
272 | - /** |
|
273 | - * @When I have :organization as my main organization |
|
274 | - * @param $orgName |
|
275 | - */ |
|
276 | - public function iHaveMainOrganization(UserInterface $user,$orgName) |
|
277 | - { |
|
278 | - /* @var $repoOrganization OrganizationRepository */ |
|
279 | - $repoOrganization = $this->coreContext->getRepositories()->get('Organizations/Organization'); |
|
280 | - $organization=$repoOrganization->findByName($orgName); |
|
281 | - if(!$organization instanceof Organization){ |
|
282 | - $organization = new Organization(); |
|
283 | - $organizationName = new OrganizationName($orgName); |
|
284 | - $organization->setOrganizationName($organizationName); |
|
285 | - $permissions = $organization->getPermissions(); |
|
286 | - $permissions->grant($user,Permissions::PERMISSION_ALL); |
|
287 | - }else { |
|
288 | - $organization->getPermissions()->grant($user,Permissions::PERMISSION_ALL); |
|
289 | - } |
|
290 | - $organization->setUser($user); |
|
291 | - $repoOrganization->store($organization); |
|
292 | - $repoOrganization->getDocumentManager()->refresh($organization); |
|
293 | - } |
|
272 | + /** |
|
273 | + * @When I have :organization as my main organization |
|
274 | + * @param $orgName |
|
275 | + */ |
|
276 | + public function iHaveMainOrganization(UserInterface $user,$orgName) |
|
277 | + { |
|
278 | + /* @var $repoOrganization OrganizationRepository */ |
|
279 | + $repoOrganization = $this->coreContext->getRepositories()->get('Organizations/Organization'); |
|
280 | + $organization=$repoOrganization->findByName($orgName); |
|
281 | + if(!$organization instanceof Organization){ |
|
282 | + $organization = new Organization(); |
|
283 | + $organizationName = new OrganizationName($orgName); |
|
284 | + $organization->setOrganizationName($organizationName); |
|
285 | + $permissions = $organization->getPermissions(); |
|
286 | + $permissions->grant($user,Permissions::PERMISSION_ALL); |
|
287 | + }else { |
|
288 | + $organization->getPermissions()->grant($user,Permissions::PERMISSION_ALL); |
|
289 | + } |
|
290 | + $organization->setUser($user); |
|
291 | + $repoOrganization->store($organization); |
|
292 | + $repoOrganization->getDocumentManager()->refresh($organization); |
|
293 | + } |
|
294 | 294 | |
295 | - /** |
|
296 | - * @When I want to log in |
|
297 | - */ |
|
298 | - public function iWantToLogIn() |
|
299 | - { |
|
300 | - $session = $this->minkContext->getSession(); |
|
301 | - $url = $this->generateUrl('lang/auth'); |
|
302 | - $session->visit($url); |
|
303 | - } |
|
295 | + /** |
|
296 | + * @When I want to log in |
|
297 | + */ |
|
298 | + public function iWantToLogIn() |
|
299 | + { |
|
300 | + $session = $this->minkContext->getSession(); |
|
301 | + $url = $this->generateUrl('lang/auth'); |
|
302 | + $session->visit($url); |
|
303 | + } |
|
304 | 304 | |
305 | - /** |
|
306 | - * @When I specify the username as :username |
|
307 | - */ |
|
308 | - public function iSpecifyTheUsernameAs($username) |
|
309 | - { |
|
310 | - $this->minkContext->fillField('Login name',$username); |
|
311 | - } |
|
305 | + /** |
|
306 | + * @When I specify the username as :username |
|
307 | + */ |
|
308 | + public function iSpecifyTheUsernameAs($username) |
|
309 | + { |
|
310 | + $this->minkContext->fillField('Login name',$username); |
|
311 | + } |
|
312 | 312 | |
313 | - /** |
|
314 | - * @When I specify the password as :password |
|
315 | - */ |
|
316 | - public function iSpecifyThePasswordAs($password) |
|
317 | - { |
|
318 | - $this->minkContext->fillField('Password',$password); |
|
319 | - } |
|
313 | + /** |
|
314 | + * @When I specify the password as :password |
|
315 | + */ |
|
316 | + public function iSpecifyThePasswordAs($password) |
|
317 | + { |
|
318 | + $this->minkContext->fillField('Password',$password); |
|
319 | + } |
|
320 | 320 | |
321 | - /** |
|
322 | - * @Given I am logged in as :username identified by :password |
|
323 | - */ |
|
324 | - public function iAmLoggedInAsIdentifiedBy($username, $password) |
|
325 | - { |
|
326 | - $repo = $this->getUserRepository(); |
|
327 | - $user = $repo->findByLogin($username); |
|
321 | + /** |
|
322 | + * @Given I am logged in as :username identified by :password |
|
323 | + */ |
|
324 | + public function iAmLoggedInAsIdentifiedBy($username, $password) |
|
325 | + { |
|
326 | + $repo = $this->getUserRepository(); |
|
327 | + $user = $repo->findByLogin($username); |
|
328 | 328 | |
329 | - if(!$user instanceof User){ |
|
330 | - throw new \Exception(sprintf('There is no user with this login: "%s"',$username)); |
|
331 | - } |
|
332 | - $this->iWantToLogIn(); |
|
333 | - $this->iSpecifyTheUsernameAs($username); |
|
334 | - $this->iSpecifyThePasswordAs($password); |
|
335 | - $this->iLogIn(); |
|
329 | + if(!$user instanceof User){ |
|
330 | + throw new \Exception(sprintf('There is no user with this login: "%s"',$username)); |
|
331 | + } |
|
332 | + $this->iWantToLogIn(); |
|
333 | + $this->iSpecifyTheUsernameAs($username); |
|
334 | + $this->iSpecifyThePasswordAs($password); |
|
335 | + $this->iLogIn(); |
|
336 | 336 | $this->currentUser = $user; |
337 | - } |
|
337 | + } |
|
338 | 338 | |
339 | - /** |
|
340 | - * @When I log in |
|
341 | - */ |
|
342 | - public function iLogIn() |
|
343 | - { |
|
344 | - $this->minkContext->pressButton('login'); |
|
345 | - } |
|
339 | + /** |
|
340 | + * @When I log in |
|
341 | + */ |
|
342 | + public function iLogIn() |
|
343 | + { |
|
344 | + $this->minkContext->pressButton('login'); |
|
345 | + } |
|
346 | 346 | |
347 | - /** |
|
348 | - * @When I press logout link |
|
349 | - */ |
|
350 | - public function iPressLogoutLink() |
|
351 | - { |
|
352 | - $url = $this->generateUrl('auth-logout'); |
|
353 | - $this->visit($url); |
|
354 | - } |
|
347 | + /** |
|
348 | + * @When I press logout link |
|
349 | + */ |
|
350 | + public function iPressLogoutLink() |
|
351 | + { |
|
352 | + $url = $this->generateUrl('auth-logout'); |
|
353 | + $this->visit($url); |
|
354 | + } |
|
355 | 355 | |
356 | - /** |
|
357 | - * @Given I log in with username :username and password :password |
|
358 | - */ |
|
359 | - public function iLogInWith($username, $password) |
|
360 | - { |
|
361 | - $repo = $this->getUserRepository(); |
|
362 | - $user = $repo->findByLogin($username); |
|
363 | - $this->iWantToLogIn(); |
|
364 | - $this->iSpecifyTheUsernameAs($username); |
|
365 | - $this->iSpecifyThePasswordAs($password); |
|
366 | - $this->iLogIn(); |
|
367 | - $this->loggedInUser = $user; |
|
368 | - } |
|
356 | + /** |
|
357 | + * @Given I log in with username :username and password :password |
|
358 | + */ |
|
359 | + public function iLogInWith($username, $password) |
|
360 | + { |
|
361 | + $repo = $this->getUserRepository(); |
|
362 | + $user = $repo->findByLogin($username); |
|
363 | + $this->iWantToLogIn(); |
|
364 | + $this->iSpecifyTheUsernameAs($username); |
|
365 | + $this->iSpecifyThePasswordAs($password); |
|
366 | + $this->iLogIn(); |
|
367 | + $this->loggedInUser = $user; |
|
368 | + } |
|
369 | 369 | |
370 | - /** |
|
371 | - * @When I go to profile page |
|
372 | - */ |
|
373 | - public function iGoToProfilePage() |
|
374 | - { |
|
375 | - $url = $this->generateUrl('lang/my'); |
|
376 | - $this->visit($url); |
|
377 | - } |
|
370 | + /** |
|
371 | + * @When I go to profile page |
|
372 | + */ |
|
373 | + public function iGoToProfilePage() |
|
374 | + { |
|
375 | + $url = $this->generateUrl('lang/my'); |
|
376 | + $this->visit($url); |
|
377 | + } |
|
378 | 378 | |
379 | - /** |
|
380 | - * @Given there is a user with the following: |
|
381 | - */ |
|
382 | - public function thereIsAUserWithTheFollowing(TableNode $table) |
|
383 | - { |
|
384 | - $repo = $this->getUserRepository(); |
|
385 | - $data = $table->getRowsHash(); |
|
386 | - $email = isset($data['email']) ? $data['email']:'[email protected]'; |
|
387 | - $password = isset($data['password']) ? $data['password']:'test'; |
|
388 | - $fullname = isset($data['fullname']) ? $data['fullname']:'Test User'; |
|
389 | - $role = isset($data['role']) ? $data['role']:User::ROLE_RECRUITER; |
|
379 | + /** |
|
380 | + * @Given there is a user with the following: |
|
381 | + */ |
|
382 | + public function thereIsAUserWithTheFollowing(TableNode $table) |
|
383 | + { |
|
384 | + $repo = $this->getUserRepository(); |
|
385 | + $data = $table->getRowsHash(); |
|
386 | + $email = isset($data['email']) ? $data['email']:'[email protected]'; |
|
387 | + $password = isset($data['password']) ? $data['password']:'test'; |
|
388 | + $fullname = isset($data['fullname']) ? $data['fullname']:'Test User'; |
|
389 | + $role = isset($data['role']) ? $data['role']:User::ROLE_RECRUITER; |
|
390 | 390 | |
391 | - if(!is_object($user=$repo->findByLogin($email))){ |
|
392 | - $user = $this->createUser($email,$password,$role,$fullname); |
|
393 | - } |
|
394 | - $this->currentUser = $user; |
|
395 | - $this->addCreatedUser($user); |
|
396 | - } |
|
391 | + if(!is_object($user=$repo->findByLogin($email))){ |
|
392 | + $user = $this->createUser($email,$password,$role,$fullname); |
|
393 | + } |
|
394 | + $this->currentUser = $user; |
|
395 | + $this->addCreatedUser($user); |
|
396 | + } |
|
397 | 397 | |
398 | - private function addCreatedUser(UserInterface $user) |
|
399 | - { |
|
400 | - if(!in_array($user,static::$users)){ |
|
401 | - static::$users[] = $user; |
|
402 | - } |
|
403 | - } |
|
398 | + private function addCreatedUser(UserInterface $user) |
|
399 | + { |
|
400 | + if(!in_array($user,static::$users)){ |
|
401 | + static::$users[] = $user; |
|
402 | + } |
|
403 | + } |
|
404 | 404 | |
405 | - /** |
|
406 | - * @When I want to change my password |
|
407 | - */ |
|
408 | - public function iWantToChangeMyPassword() |
|
409 | - { |
|
410 | - $url = $this->generateUrl('lang/my-password'); |
|
411 | - $this->visit($url); |
|
412 | - } |
|
405 | + /** |
|
406 | + * @When I want to change my password |
|
407 | + */ |
|
408 | + public function iWantToChangeMyPassword() |
|
409 | + { |
|
410 | + $url = $this->generateUrl('lang/my-password'); |
|
411 | + $this->visit($url); |
|
412 | + } |
|
413 | 413 | |
414 | 414 | /** |
415 | 415 | * @return User |
416 | 416 | */ |
417 | - public function getCurrentUser() |
|
417 | + public function getCurrentUser() |
|
418 | 418 | { |
419 | 419 | return $this->currentUser; |
420 | 420 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | protected $currentUser; |
66 | 66 | |
67 | - public function __construct($parameters=[]) |
|
67 | + public function __construct($parameters = []) |
|
68 | 68 | { |
69 | 69 | $defaultLoginInfo = [ |
70 | 70 | 'facebook' => [ |
@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | 'session_password-login' => getenv('LINKEDIN_USER_PASSWORD') |
77 | 77 | ], |
78 | 78 | ]; |
79 | - $socialLoginConfig = isset($parameters['social_login_info']) ? $parameters['social_login_info']:[]; |
|
80 | - $this->socialLoginInfo = array_merge($defaultLoginInfo,$socialLoginConfig); |
|
79 | + $socialLoginConfig = isset($parameters['social_login_info']) ? $parameters['social_login_info'] : []; |
|
80 | + $this->socialLoginInfo = array_merge($defaultLoginInfo, $socialLoginConfig); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
@@ -87,12 +87,12 @@ discard block |
||
87 | 87 | static public function afterSuite(AfterSuiteScope $scope) |
88 | 88 | { |
89 | 89 | $repo = static::$userRepo; |
90 | - foreach(static::$users as $user){ |
|
91 | - if($repo->findByLogin($user->getLogin())){ |
|
92 | - try{ |
|
90 | + foreach (static::$users as $user) { |
|
91 | + if ($repo->findByLogin($user->getLogin())) { |
|
92 | + try { |
|
93 | 93 | JobContext::removeJobByUser($user); |
94 | - $repo->remove($user,true); |
|
95 | - }catch (\Exception $e){ |
|
94 | + $repo->remove($user, true); |
|
95 | + } catch (\Exception $e) { |
|
96 | 96 | |
97 | 97 | } |
98 | 98 | } |
@@ -117,8 +117,8 @@ discard block |
||
117 | 117 | { |
118 | 118 | $provider = strtolower($provider); |
119 | 119 | $mink = $this->minkContext; |
120 | - foreach($this->socialLoginInfo[$provider] as $field=>$value){ |
|
121 | - $mink->fillField($field,$value); |
|
120 | + foreach ($this->socialLoginInfo[$provider] as $field=>$value) { |
|
121 | + $mink->fillField($field, $value); |
|
122 | 122 | } |
123 | 123 | } |
124 | 124 | |
@@ -126,15 +126,15 @@ discard block |
||
126 | 126 | * @Given I am logged in as a recruiter |
127 | 127 | * @Given I am logged in as a recruiter with :organization as organization |
128 | 128 | */ |
129 | - public function iAmLoggedInAsARecruiter($organization=null) |
|
129 | + public function iAmLoggedInAsARecruiter($organization = null) |
|
130 | 130 | { |
131 | 131 | $user = $this->thereIsAUserIdentifiedBy( |
132 | 132 | '[email protected]', |
133 | - 'test',User::ROLE_RECRUITER, |
|
133 | + 'test', User::ROLE_RECRUITER, |
|
134 | 134 | 'Test Recruiter', |
135 | 135 | $organization |
136 | 136 | ); |
137 | - $this->startLogin($user,'test'); |
|
137 | + $this->startLogin($user, 'test'); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
@@ -144,9 +144,9 @@ discard block |
||
144 | 144 | public function iDonTHaveUser($login) |
145 | 145 | { |
146 | 146 | $repo = $this->getUserRepository(); |
147 | - $user=$repo->findByLogin($login); |
|
148 | - if($user instanceof UserInterface){ |
|
149 | - $repo->remove($user,true); |
|
147 | + $user = $repo->findByLogin($login); |
|
148 | + if ($user instanceof UserInterface) { |
|
149 | + $repo->remove($user, true); |
|
150 | 150 | } |
151 | 151 | } |
152 | 152 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | * @param $role |
156 | 156 | * @param TableNode $fields |
157 | 157 | */ |
158 | - public function iHaveUserWithTheFollowing($role,TableNode $fields) |
|
158 | + public function iHaveUserWithTheFollowing($role, TableNode $fields) |
|
159 | 159 | { |
160 | 160 | $normalizedFields = [ |
161 | 161 | 'login' => '[email protected]', |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | 'password' => 'test', |
165 | 165 | 'organization' => 'Cross Solution' |
166 | 166 | ]; |
167 | - foreach($fields->getRowsHash() as $field=>$value){ |
|
167 | + foreach ($fields->getRowsHash() as $field=>$value) { |
|
168 | 168 | $field = Inflector::camelize($field); |
169 | 169 | $normalizedFields[$field] = $value; |
170 | 170 | } |
@@ -184,14 +184,14 @@ discard block |
||
184 | 184 | */ |
185 | 185 | public function iAmLoggedInAsAnAdmin() |
186 | 186 | { |
187 | - $user = $this->thereIsAUserIdentifiedBy('[email protected]','test',User::ROLE_ADMIN); |
|
188 | - $this->startLogin($user,'test'); |
|
187 | + $user = $this->thereIsAUserIdentifiedBy('[email protected]', 'test', User::ROLE_ADMIN); |
|
188 | + $this->startLogin($user, 'test'); |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | private function startLogin(UserInterface $user, $password) |
192 | 192 | { |
193 | 193 | $currentUser = $this->currentUser; |
194 | - if(!is_object($currentUser) || $user->getId()!=$currentUser->getId()){ |
|
194 | + if (!is_object($currentUser) || $user->getId() != $currentUser->getId()) { |
|
195 | 195 | $this->iWantToLogIn(); |
196 | 196 | $this->iSpecifyTheUsernameAs($user->getLogin()); |
197 | 197 | $this->iSpecifyThePasswordAs($password); |
@@ -211,15 +211,15 @@ discard block |
||
211 | 211 | /** |
212 | 212 | * @Given there is a user :email identified by :password |
213 | 213 | */ |
214 | - public function thereIsAUserIdentifiedBy($email, $password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter",$organization=null) |
|
214 | + public function thereIsAUserIdentifiedBy($email, $password, $role = User::ROLE_RECRUITER, $fullname = "Test Recruiter", $organization = null) |
|
215 | 215 | { |
216 | 216 | $repo = $this->getUserRepository(); |
217 | - if(!is_object($user=$repo->findByEmail($email))){ |
|
218 | - $user = $this->createUser($email,$password,$role,$fullname,$organization); |
|
217 | + if (!is_object($user = $repo->findByEmail($email))) { |
|
218 | + $user = $this->createUser($email, $password, $role, $fullname, $organization); |
|
219 | 219 | } |
220 | 220 | |
221 | - if(!is_null($organization)){ |
|
222 | - $this->iHaveMainOrganization($user,$organization); |
|
221 | + if (!is_null($organization)) { |
|
222 | + $this->iHaveMainOrganization($user, $organization); |
|
223 | 223 | } |
224 | 224 | $this->addCreatedUser($user); |
225 | 225 | return $user; |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | * |
235 | 235 | * @return \Auth\Entity\UserInterface |
236 | 236 | */ |
237 | - public function createUser($email,$password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter") |
|
237 | + public function createUser($email, $password, $role = User::ROLE_RECRUITER, $fullname = "Test Recruiter") |
|
238 | 238 | { |
239 | 239 | /* @var Register $service */ |
240 | 240 | /* @var User $user */ |
@@ -245,10 +245,10 @@ discard block |
||
245 | 245 | $user->setRole($role); |
246 | 246 | $settings = $user->getSettings('Applications'); |
247 | 247 | |
248 | - $expFullName = explode(' ',$fullname); |
|
248 | + $expFullName = explode(' ', $fullname); |
|
249 | 249 | $info = $user->getInfo(); |
250 | 250 | $info->setFirstName(array_shift($expFullName)); |
251 | - $info->setLastName(count($expFullName)>0 ? implode(' ',$expFullName):''); |
|
251 | + $info->setLastName(count($expFullName) > 0 ? implode(' ', $expFullName) : ''); |
|
252 | 252 | $info->setEmail($email); |
253 | 253 | $info->setEmailVerified(true); |
254 | 254 | $repo->store($user); |
@@ -273,19 +273,19 @@ discard block |
||
273 | 273 | * @When I have :organization as my main organization |
274 | 274 | * @param $orgName |
275 | 275 | */ |
276 | - public function iHaveMainOrganization(UserInterface $user,$orgName) |
|
276 | + public function iHaveMainOrganization(UserInterface $user, $orgName) |
|
277 | 277 | { |
278 | 278 | /* @var $repoOrganization OrganizationRepository */ |
279 | 279 | $repoOrganization = $this->coreContext->getRepositories()->get('Organizations/Organization'); |
280 | - $organization=$repoOrganization->findByName($orgName); |
|
281 | - if(!$organization instanceof Organization){ |
|
280 | + $organization = $repoOrganization->findByName($orgName); |
|
281 | + if (!$organization instanceof Organization) { |
|
282 | 282 | $organization = new Organization(); |
283 | 283 | $organizationName = new OrganizationName($orgName); |
284 | 284 | $organization->setOrganizationName($organizationName); |
285 | 285 | $permissions = $organization->getPermissions(); |
286 | - $permissions->grant($user,Permissions::PERMISSION_ALL); |
|
287 | - }else { |
|
288 | - $organization->getPermissions()->grant($user,Permissions::PERMISSION_ALL); |
|
286 | + $permissions->grant($user, Permissions::PERMISSION_ALL); |
|
287 | + } else { |
|
288 | + $organization->getPermissions()->grant($user, Permissions::PERMISSION_ALL); |
|
289 | 289 | } |
290 | 290 | $organization->setUser($user); |
291 | 291 | $repoOrganization->store($organization); |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | */ |
308 | 308 | public function iSpecifyTheUsernameAs($username) |
309 | 309 | { |
310 | - $this->minkContext->fillField('Login name',$username); |
|
310 | + $this->minkContext->fillField('Login name', $username); |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | /** |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | */ |
316 | 316 | public function iSpecifyThePasswordAs($password) |
317 | 317 | { |
318 | - $this->minkContext->fillField('Password',$password); |
|
318 | + $this->minkContext->fillField('Password', $password); |
|
319 | 319 | } |
320 | 320 | |
321 | 321 | /** |
@@ -326,8 +326,8 @@ discard block |
||
326 | 326 | $repo = $this->getUserRepository(); |
327 | 327 | $user = $repo->findByLogin($username); |
328 | 328 | |
329 | - if(!$user instanceof User){ |
|
330 | - throw new \Exception(sprintf('There is no user with this login: "%s"',$username)); |
|
329 | + if (!$user instanceof User) { |
|
330 | + throw new \Exception(sprintf('There is no user with this login: "%s"', $username)); |
|
331 | 331 | } |
332 | 332 | $this->iWantToLogIn(); |
333 | 333 | $this->iSpecifyTheUsernameAs($username); |
@@ -383,13 +383,13 @@ discard block |
||
383 | 383 | { |
384 | 384 | $repo = $this->getUserRepository(); |
385 | 385 | $data = $table->getRowsHash(); |
386 | - $email = isset($data['email']) ? $data['email']:'[email protected]'; |
|
387 | - $password = isset($data['password']) ? $data['password']:'test'; |
|
388 | - $fullname = isset($data['fullname']) ? $data['fullname']:'Test User'; |
|
389 | - $role = isset($data['role']) ? $data['role']:User::ROLE_RECRUITER; |
|
386 | + $email = isset($data['email']) ? $data['email'] : '[email protected]'; |
|
387 | + $password = isset($data['password']) ? $data['password'] : 'test'; |
|
388 | + $fullname = isset($data['fullname']) ? $data['fullname'] : 'Test User'; |
|
389 | + $role = isset($data['role']) ? $data['role'] : User::ROLE_RECRUITER; |
|
390 | 390 | |
391 | - if(!is_object($user=$repo->findByLogin($email))){ |
|
392 | - $user = $this->createUser($email,$password,$role,$fullname); |
|
391 | + if (!is_object($user = $repo->findByLogin($email))) { |
|
392 | + $user = $this->createUser($email, $password, $role, $fullname); |
|
393 | 393 | } |
394 | 394 | $this->currentUser = $user; |
395 | 395 | $this->addCreatedUser($user); |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | |
398 | 398 | private function addCreatedUser(UserInterface $user) |
399 | 399 | { |
400 | - if(!in_array($user,static::$users)){ |
|
400 | + if (!in_array($user, static::$users)) { |
|
401 | 401 | static::$users[] = $user; |
402 | 402 | } |
403 | 403 | } |