Completed
Push — develop ( da1ae8...af9759 )
by Mathias
21s queued 14s
created
module/Behat/src/OrganizationContext.php 1 patch
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -30,12 +30,12 @@  discard block
 block discarded – undo
30 30
  */
31 31
 class OrganizationContext implements Context
32 32
 {
33
-	use CommonContextTrait;
33
+    use CommonContextTrait;
34 34
 
35 35
     /**
36 36
      * @var JobContext
37 37
      */
38
-	private $jobContext;
38
+    private $jobContext;
39 39
 
40 40
     /**
41 41
      * @BeforeScenario
@@ -47,51 +47,51 @@  discard block
 block discarded – undo
47 47
         $this->jobContext = $scope->getEnvironment()->getContext(JobContext::class);
48 48
     }
49 49
 
50
-	/**
51
-	 * @Given I go to my organization page
52
-	 */
53
-	public function iGoToMyOrganizationPage()
54
-	{
50
+    /**
51
+     * @Given I go to my organization page
52
+     */
53
+    public function iGoToMyOrganizationPage()
54
+    {
55 55
         $url = $this->buildUrl('lang/my-organization');
56
-		$this->visit($url);
57
-	}
56
+        $this->visit($url);
57
+    }
58 58
 	
59
-	/**
60
-	 * @When I hover over name form
61
-	 */
62
-	public function iMouseOverOrganizationNameForm()
63
-	{
64
-		$locator = '#sf-nameForm .sf-summary';
65
-		$this->coreContext->iHoverOverTheElement($locator);
66
-	}
59
+    /**
60
+     * @When I hover over name form
61
+     */
62
+    public function iMouseOverOrganizationNameForm()
63
+    {
64
+        $locator = '#sf-nameForm .sf-summary';
65
+        $this->coreContext->iHoverOverTheElement($locator);
66
+    }
67 67
 	
68
-	/**
69
-	 * @Given I go to create new organization page
70
-	 */
71
-	public function iGoToCreateNewOrganizationPage()
72
-	{
73
-		//$this->visit('/organizations/edit');
68
+    /**
69
+     * @Given I go to create new organization page
70
+     */
71
+    public function iGoToCreateNewOrganizationPage()
72
+    {
73
+        //$this->visit('/organizations/edit');
74 74
         $url = $this->buildUrl('lang/organizations/edit');
75 75
         $this->visit($url);
76
-	}
76
+    }
77 77
 	
78
-	/**
79
-	 * @Given I go to organization overview page
80
-	 */
81
-	public function iGoToOrganizationOverviewPage()
82
-	{
83
-		//$this->visit('/organizations');
84
-		$url = $this->buildUrl('lang/organizations');
85
-		$this->visit($url);
86
-	}
78
+    /**
79
+     * @Given I go to organization overview page
80
+     */
81
+    public function iGoToOrganizationOverviewPage()
82
+    {
83
+        //$this->visit('/organizations');
84
+        $url = $this->buildUrl('lang/organizations');
85
+        $this->visit($url);
86
+    }
87 87
 
88 88
     /**
89 89
      * @Given I want to see list organization profiles
90 90
      */
91
-	public function iWantToSeeListOrganizationProfiles()
91
+    public function iWantToSeeListOrganizationProfiles()
92 92
     {
93
-       $url = $this->buildUrl('lang/organizations/profile');
94
-       $this->visit($url);
93
+        $url = $this->buildUrl('lang/organizations/profile');
94
+        $this->visit($url);
95 95
     }
96 96
 
97 97
     /**
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
      * @internal param string $name
101 101
      * @internal param TableNode|null $table
102 102
      */
103
-	public function iHaveOrganization($name)
103
+    public function iHaveOrganization($name)
104 104
     {
105 105
         $user = $this->getUserContext()->getCurrentUser();
106 106
         $organization = $this->findOrganizationByName($name,false);
Please login to merge, or discard this patch.
module/Behat/src/UserContext.php 1 patch
Indentation   +311 added lines, -311 removed lines patch added patch discarded remove patch
@@ -31,60 +31,60 @@  discard block
 block discarded – undo
31 31
 {
32 32
     use CommonContextTrait;
33 33
 	
34
-	/**
35
-	 * @var User[]
36
-	 */
37
-	static private $users = [];
34
+    /**
35
+     * @var User[]
36
+     */
37
+    static private $users = [];
38 38
 	
39
-	/**
40
-	 * @var UserRepository
41
-	 */
42
-	static private $userRepo;
39
+    /**
40
+     * @var UserRepository
41
+     */
42
+    static private $userRepo;
43 43
 	
44
-	private $socialLoginInfo = [];
44
+    private $socialLoginInfo = [];
45 45
 
46 46
     /**
47 47
      * @var DocumentManager
48 48
      */
49
-	static private $dm;
49
+    static private $dm;
50 50
 	
51
-	/**
52
-	 * @var UserInterface
53
-	 */
54
-	private $loggedInUser;
51
+    /**
52
+     * @var UserInterface
53
+     */
54
+    private $loggedInUser;
55 55
 
56 56
     /**
57 57
      * @var Organization
58 58
      */
59
-	private $mainOrganization;
59
+    private $mainOrganization;
60 60
 
61 61
     /**
62 62
      * @var User
63 63
      */
64 64
     protected $currentUser;
65 65
 	
66
-	public function __construct($parameters=[])
67
-	{
68
-		$defaultLoginInfo = [
69
-			'facebook' => [
70
-				'email' => getenv('FACEBOOK_USER_EMAIL'),
71
-				'pass' => getenv('FACEBOOK_USER_PASSWORD')
72
-			],
73
-			'linkedin' => [
74
-				'session_key-login' => getenv('LINKEDIN_USER_EMAIL'),
75
-				'session_password-login' => getenv('LINKEDIN_USER_PASSWORD')
76
-			],
77
-		];
78
-		$socialLoginConfig = isset($parameters['social_login_info']) ? $parameters['social_login_info']:[];
79
-		$this->socialLoginInfo = array_merge($defaultLoginInfo,$socialLoginConfig);
80
-	}
66
+    public function __construct($parameters=[])
67
+    {
68
+        $defaultLoginInfo = [
69
+            'facebook' => [
70
+                'email' => getenv('FACEBOOK_USER_EMAIL'),
71
+                'pass' => getenv('FACEBOOK_USER_PASSWORD')
72
+            ],
73
+            'linkedin' => [
74
+                'session_key-login' => getenv('LINKEDIN_USER_EMAIL'),
75
+                'session_password-login' => getenv('LINKEDIN_USER_PASSWORD')
76
+            ],
77
+        ];
78
+        $socialLoginConfig = isset($parameters['social_login_info']) ? $parameters['social_login_info']:[];
79
+        $this->socialLoginInfo = array_merge($defaultLoginInfo,$socialLoginConfig);
80
+    }
81 81
 
82 82
     /**
83 83
      * Empty all data every each tests
84 84
      *
85 85
      * @AfterSuite
86 86
      */
87
-	static public function tearDown()
87
+    static public function tearDown()
88 88
     {
89 89
         $dm = static::$dm;
90 90
 
@@ -107,47 +107,47 @@  discard block
 block discarded – undo
107 107
         }
108 108
     }
109 109
 
110
-	/**
111
-	 * @BeforeScenario
112
-	 * @param BeforeScenarioScope $scope
113
-	 */
114
-	public function beforeScenario(BeforeScenarioScope $scope)
115
-	{
116
-		$this->minkContext = $scope->getEnvironment()->getContext(MinkContext::class);
117
-		$this->coreContext = $scope->getEnvironment()->getContext(CoreContext::class);
118
-		static::$userRepo = $this->getUserRepository();
119
-		static::$dm = $this->getUserRepository()->getDocumentManager();
120
-	}
110
+    /**
111
+     * @BeforeScenario
112
+     * @param BeforeScenarioScope $scope
113
+     */
114
+    public function beforeScenario(BeforeScenarioScope $scope)
115
+    {
116
+        $this->minkContext = $scope->getEnvironment()->getContext(MinkContext::class);
117
+        $this->coreContext = $scope->getEnvironment()->getContext(CoreContext::class);
118
+        static::$userRepo = $this->getUserRepository();
119
+        static::$dm = $this->getUserRepository()->getDocumentManager();
120
+    }
121 121
 	
122
-	/**
123
-	 * @When I fill in login form with :provider user
124
-	 */
125
-	public function iSignInWithSocialUser($provider)
126
-	{
127
-		$provider = strtolower($provider);
128
-		$mink = $this->minkContext;
129
-		foreach($this->socialLoginInfo[$provider] as $field=>$value){
130
-			$mink->fillField($field,$value);
131
-		}
132
-	}
122
+    /**
123
+     * @When I fill in login form with :provider user
124
+     */
125
+    public function iSignInWithSocialUser($provider)
126
+    {
127
+        $provider = strtolower($provider);
128
+        $mink = $this->minkContext;
129
+        foreach($this->socialLoginInfo[$provider] as $field=>$value){
130
+            $mink->fillField($field,$value);
131
+        }
132
+    }
133 133
 	
134
-	/**
135
-	 * @Given I am logged in as a recruiter
136
-	 * @Given I am logged in as a recruiter with :organization as organization
137
-	 */
138
-	public function iAmLoggedInAsARecruiter($organization=null)
139
-	{
140
-		$user = $this->thereIsAUserIdentifiedBy(
141
-			'[email protected]',
142
-			'test',User::ROLE_RECRUITER,
143
-			'Test Recruiter',
144
-			$organization
145
-		);
146
-		$this->startLogin($user,'test');
147
-		if(!is_null($organization)){
134
+    /**
135
+     * @Given I am logged in as a recruiter
136
+     * @Given I am logged in as a recruiter with :organization as organization
137
+     */
138
+    public function iAmLoggedInAsARecruiter($organization=null)
139
+    {
140
+        $user = $this->thereIsAUserIdentifiedBy(
141
+            '[email protected]',
142
+            'test',User::ROLE_RECRUITER,
143
+            'Test Recruiter',
144
+            $organization
145
+        );
146
+        $this->startLogin($user,'test');
147
+        if(!is_null($organization)){
148 148
             $this->iHaveMainOrganization($user,$organization);
149 149
         }
150
-	}
150
+    }
151 151
 
152 152
     /**
153 153
      * @Given I am logged out
@@ -159,156 +159,156 @@  discard block
 block discarded – undo
159 159
     }
160 160
 
161 161
 	
162
-	/**
163
-	 * @Given I don't have :login user
164
-	 * @param string $login
165
-	 */
166
-	public function iDonTHaveUser($login)
167
-	{
168
-		$repo = $this->getUserRepository();
169
-		$user=$repo->findByLogin($login);
170
-		if($user instanceof UserInterface){
171
-			$repo->remove($user,true);
172
-		}
173
-	}
162
+    /**
163
+     * @Given I don't have :login user
164
+     * @param string $login
165
+     */
166
+    public function iDonTHaveUser($login)
167
+    {
168
+        $repo = $this->getUserRepository();
169
+        $user=$repo->findByLogin($login);
170
+        if($user instanceof UserInterface){
171
+            $repo->remove($user,true);
172
+        }
173
+    }
174 174
 	
175
-	/**
176
-	 * @Given I have a :role with the following:
175
+    /**
176
+     * @Given I have a :role with the following:
177 177
      * @Given I have an :role with the following:
178 178
      *
179
-	 * @param $role
180
-	 * @param TableNode $fields
181
-	 */
182
-	public function iHaveUserWithTheFollowing($role,TableNode $fields)
183
-	{
184
-		$normalizedFields = [
185
-			'login' => '[email protected]',
186
-			'fullName' => 'Test Login',
187
-			'role' => $role,
188
-			'password' => 'test',
189
-			'organization' => 'Cross Solution'
190
-		];
191
-		foreach($fields->getRowsHash() as $field=>$value){
192
-			$field = Inflector::camelize($field);
193
-			$normalizedFields[$field] = $value;
194
-		}
179
+     * @param $role
180
+     * @param TableNode $fields
181
+     */
182
+    public function iHaveUserWithTheFollowing($role,TableNode $fields)
183
+    {
184
+        $normalizedFields = [
185
+            'login' => '[email protected]',
186
+            'fullName' => 'Test Login',
187
+            'role' => $role,
188
+            'password' => 'test',
189
+            'organization' => 'Cross Solution'
190
+        ];
191
+        foreach($fields->getRowsHash() as $field=>$value){
192
+            $field = Inflector::camelize($field);
193
+            $normalizedFields[$field] = $value;
194
+        }
195 195
 		
196
-		$this->thereIsAUserIdentifiedBy(
197
-			$normalizedFields['login'],
198
-			$normalizedFields['password'],
199
-			$role,
200
-			$normalizedFields['fullName'],
201
-			$normalizedFields['organization']
202
-		);
196
+        $this->thereIsAUserIdentifiedBy(
197
+            $normalizedFields['login'],
198
+            $normalizedFields['password'],
199
+            $role,
200
+            $normalizedFields['fullName'],
201
+            $normalizedFields['organization']
202
+        );
203 203
 		
204
-	}
204
+    }
205 205
 	
206
-	/**
207
-	 * @Given I am logged in as an administrator
208
-	 */
209
-	public function iAmLoggedInAsAnAdmin()
210
-	{
211
-		$user = $this->thereIsAUserIdentifiedBy('[email protected]','test',User::ROLE_ADMIN);
212
-		$this->startLogin($user,'test');
213
-	}
206
+    /**
207
+     * @Given I am logged in as an administrator
208
+     */
209
+    public function iAmLoggedInAsAnAdmin()
210
+    {
211
+        $user = $this->thereIsAUserIdentifiedBy('[email protected]','test',User::ROLE_ADMIN);
212
+        $this->startLogin($user,'test');
213
+    }
214 214
 	
215
-	private function startLogin(UserInterface $user, $password)
216
-	{
217
-		$currentUser = $this->currentUser;
218
-		if(!is_object($currentUser) || $user->getId()!=$currentUser->getId()){
219
-			$this->iWantToLogIn();
220
-			$this->iSpecifyTheUsernameAs($user->getLogin());
221
-			$this->iSpecifyThePasswordAs($password);
222
-			$this->iLogIn();
223
-			$this->currentUser = $user;
224
-		}
225
-	}
215
+    private function startLogin(UserInterface $user, $password)
216
+    {
217
+        $currentUser = $this->currentUser;
218
+        if(!is_object($currentUser) || $user->getId()!=$currentUser->getId()){
219
+            $this->iWantToLogIn();
220
+            $this->iSpecifyTheUsernameAs($user->getLogin());
221
+            $this->iSpecifyThePasswordAs($password);
222
+            $this->iLogIn();
223
+            $this->currentUser = $user;
224
+        }
225
+    }
226 226
 	
227
-	/**
228
-	 * @return UserRepository
229
-	 */
230
-	public function getUserRepository()
231
-	{
232
-		return $this->coreContext->getRepositories()->get('Auth\Entity\User');
233
-	}
227
+    /**
228
+     * @return UserRepository
229
+     */
230
+    public function getUserRepository()
231
+    {
232
+        return $this->coreContext->getRepositories()->get('Auth\Entity\User');
233
+    }
234 234
 	
235
-	/**
236
-	 * @Given there is a user :email identified by :password
237
-	 */
238
-	public function thereIsAUserIdentifiedBy($email, $password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter",$organization=null)
239
-	{
240
-		$repo = $this->getUserRepository();
241
-		if(!is_object($user=$repo->findByEmail($email))){
242
-			$user = $this->createUser($email,$password,$role,$fullname,$organization);
243
-		}
235
+    /**
236
+     * @Given there is a user :email identified by :password
237
+     */
238
+    public function thereIsAUserIdentifiedBy($email, $password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter",$organization=null)
239
+    {
240
+        $repo = $this->getUserRepository();
241
+        if(!is_object($user=$repo->findByEmail($email))){
242
+            $user = $this->createUser($email,$password,$role,$fullname,$organization);
243
+        }
244 244
 		
245
-		if(!is_null($organization)){
246
-			$this->iHaveMainOrganization($user,$organization);
247
-		}
248
-		$this->addCreatedUser($user);
249
-		$repo->getDocumentManager()->refresh($user);
250
-		return $user;
251
-	}
245
+        if(!is_null($organization)){
246
+            $this->iHaveMainOrganization($user,$organization);
247
+        }
248
+        $this->addCreatedUser($user);
249
+        $repo->getDocumentManager()->refresh($user);
250
+        return $user;
251
+    }
252 252
 	
253
-	/**
254
-	 * @param $email
255
-	 * @param $password
256
-	 * @param $username
257
-	 * @param string $fullname
258
-	 * @param string $role
259
-	 *
260
-	 * @return \Auth\Entity\UserInterface
261
-	 */
262
-	public function createUser($email,$password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter")
263
-	{
264
-		/* @var Register $service */
265
-		/* @var User $user */
266
-		$repo = $this->getUserRepository();
267
-		$user = $repo->create([]);
268
-		$user->setLogin($email);
269
-		$user->setPassword($password);
270
-		$user->setRole($role);
271
-		$settings = $user->getSettings('Applications');
253
+    /**
254
+     * @param $email
255
+     * @param $password
256
+     * @param $username
257
+     * @param string $fullname
258
+     * @param string $role
259
+     *
260
+     * @return \Auth\Entity\UserInterface
261
+     */
262
+    public function createUser($email,$password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter")
263
+    {
264
+        /* @var Register $service */
265
+        /* @var User $user */
266
+        $repo = $this->getUserRepository();
267
+        $user = $repo->create([]);
268
+        $user->setLogin($email);
269
+        $user->setPassword($password);
270
+        $user->setRole($role);
271
+        $settings = $user->getSettings('Applications');
272 272
 		
273
-		$expFullName = explode(' ',$fullname);
274
-		$info = $user->getInfo();
275
-		$info->setFirstName(array_shift($expFullName));
276
-		$info->setLastName(count($expFullName)>0 ? implode(' ',$expFullName):'');
277
-		$info->setEmail($email);
278
-		$info->setEmailVerified(true);
279
-		$repo->store($user);
280
-		$repo->getDocumentManager()->refresh($user);
273
+        $expFullName = explode(' ',$fullname);
274
+        $info = $user->getInfo();
275
+        $info->setFirstName(array_shift($expFullName));
276
+        $info->setLastName(count($expFullName)>0 ? implode(' ',$expFullName):'');
277
+        $info->setEmail($email);
278
+        $info->setEmailVerified(true);
279
+        $repo->store($user);
280
+        $repo->getDocumentManager()->refresh($user);
281 281
 		
282
-		$eventArgs = new LifecycleEventArgs($user, $repo->getDocumentManager());
283
-		$repo->getDocumentManager()->getEventManager()->dispatchEvent(
284
-			Events::postLoad,
285
-			$eventArgs
286
-		);
287
-		/* @var \Core\EventManager\EventManager $events */
288
-		/* @var \Auth\Listener\Events\AuthEvent $event */
289
-		//@TODO: [Behat] event not working in travis
290
-		//$events = $this->coreContext->getEventManager();
291
-		//$event  = $events->getEvent(AuthEvent::EVENT_USER_REGISTERED, $this);
292
-		//$event->setUser($user);
293
-		//$events->triggerEvent($event);
294
-		return $user;
295
-	}
282
+        $eventArgs = new LifecycleEventArgs($user, $repo->getDocumentManager());
283
+        $repo->getDocumentManager()->getEventManager()->dispatchEvent(
284
+            Events::postLoad,
285
+            $eventArgs
286
+        );
287
+        /* @var \Core\EventManager\EventManager $events */
288
+        /* @var \Auth\Listener\Events\AuthEvent $event */
289
+        //@TODO: [Behat] event not working in travis
290
+        //$events = $this->coreContext->getEventManager();
291
+        //$event  = $events->getEvent(AuthEvent::EVENT_USER_REGISTERED, $this);
292
+        //$event->setUser($user);
293
+        //$events->triggerEvent($event);
294
+        return $user;
295
+    }
296 296
 	
297
-	/**
298
-	 * @When I have :organization as my main organization
299
-	 * @param $orgName
300
-	 */
301
-	public function iHaveMainOrganization(UserInterface $user,$orgName)
302
-	{
303
-		/* @var $repoOrganization OrganizationRepository */
304
-		$repoOrganization = $this->coreContext->getRepositories()->get('Organizations/Organization');
305
-		$result = $repoOrganization->findByName($orgName);
306
-		$organization = count($result) > 0 ? $result[0]:null;
307
-		if(!$organization instanceof Organization){
308
-			$organization = new Organization();
309
-			$organizationName = new OrganizationName($orgName);
310
-			$organization->setOrganizationName($organizationName);
311
-		}
297
+    /**
298
+     * @When I have :organization as my main organization
299
+     * @param $orgName
300
+     */
301
+    public function iHaveMainOrganization(UserInterface $user,$orgName)
302
+    {
303
+        /* @var $repoOrganization OrganizationRepository */
304
+        $repoOrganization = $this->coreContext->getRepositories()->get('Organizations/Organization');
305
+        $result = $repoOrganization->findByName($orgName);
306
+        $organization = count($result) > 0 ? $result[0]:null;
307
+        if(!$organization instanceof Organization){
308
+            $organization = new Organization();
309
+            $organizationName = new OrganizationName($orgName);
310
+            $organization->setOrganizationName($organizationName);
311
+        }
312 312
         $organization->setProfileSetting(Organization::PROFILE_ALWAYS_ENABLE);
313 313
         $permissions = $organization->getPermissions();
314 314
         $permissions->grant($user,Permissions::PERMISSION_ALL);
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
         $repoOrganization->getDocumentManager()->refresh($organization);
319 319
 
320 320
         $this->mainOrganization = $organization;
321
-	}
321
+    }
322 322
 
323 323
     /**
324 324
      * @return Organization
@@ -328,130 +328,130 @@  discard block
 block discarded – undo
328 328
         return $this->mainOrganization;
329 329
     }
330 330
 
331
-	/**
332
-	 * @When I want to log in
333
-	 */
334
-	public function iWantToLogIn()
335
-	{
336
-		$session = $this->minkContext->getSession();
337
-		$url = $this->buildUrl('lang/auth');
338
-		$session->visit($url);
339
-	}
331
+    /**
332
+     * @When I want to log in
333
+     */
334
+    public function iWantToLogIn()
335
+    {
336
+        $session = $this->minkContext->getSession();
337
+        $url = $this->buildUrl('lang/auth');
338
+        $session->visit($url);
339
+    }
340 340
 	
341
-	/**
342
-	 * @When I specify the username as :username
343
-	 */
344
-	public function iSpecifyTheUsernameAs($username)
345
-	{
346
-		$this->minkContext->fillField('Login name',$username);
347
-	}
341
+    /**
342
+     * @When I specify the username as :username
343
+     */
344
+    public function iSpecifyTheUsernameAs($username)
345
+    {
346
+        $this->minkContext->fillField('Login name',$username);
347
+    }
348 348
 	
349
-	/**
350
-	 * @When I specify the password as :password
351
-	 */
352
-	public function iSpecifyThePasswordAs($password)
353
-	{
354
-		$this->minkContext->fillField('Password',$password);
355
-	}
349
+    /**
350
+     * @When I specify the password as :password
351
+     */
352
+    public function iSpecifyThePasswordAs($password)
353
+    {
354
+        $this->minkContext->fillField('Password',$password);
355
+    }
356 356
 	
357
-	/**
358
-	 * @Given I am logged in as :username identified by :password
359
-	 */
360
-	public function iAmLoggedInAsIdentifiedBy($username, $password)
361
-	{
362
-		$repo = $this->getUserRepository();
363
-		$user = $repo->findByLogin($username);
357
+    /**
358
+     * @Given I am logged in as :username identified by :password
359
+     */
360
+    public function iAmLoggedInAsIdentifiedBy($username, $password)
361
+    {
362
+        $repo = $this->getUserRepository();
363
+        $user = $repo->findByLogin($username);
364 364
 		
365
-		if(!$user instanceof User){
366
-			throw new \Exception(sprintf('There is no user with this login: "%s"',$username));
367
-		}
368
-		$this->iWantToLogIn();
369
-		$this->iSpecifyTheUsernameAs($username);
370
-		$this->iSpecifyThePasswordAs($password);
371
-		$this->iLogIn();
365
+        if(!$user instanceof User){
366
+            throw new \Exception(sprintf('There is no user with this login: "%s"',$username));
367
+        }
368
+        $this->iWantToLogIn();
369
+        $this->iSpecifyTheUsernameAs($username);
370
+        $this->iSpecifyThePasswordAs($password);
371
+        $this->iLogIn();
372 372
         $this->currentUser = $user;
373
-	}
373
+    }
374 374
 	
375
-	/**
376
-	 * @When I log in
377
-	 */
378
-	public function iLogIn()
379
-	{
380
-		$this->minkContext->pressButton('login');
381
-	}
375
+    /**
376
+     * @When I log in
377
+     */
378
+    public function iLogIn()
379
+    {
380
+        $this->minkContext->pressButton('login');
381
+    }
382 382
 	
383
-	/**
384
-	 * @When I press logout link
385
-	 */
386
-	public function iPressLogoutLink()
387
-	{
388
-		$url = $this->buildUrl('auth-logout');
389
-		$this->visit($url);
390
-	}
383
+    /**
384
+     * @When I press logout link
385
+     */
386
+    public function iPressLogoutLink()
387
+    {
388
+        $url = $this->buildUrl('auth-logout');
389
+        $this->visit($url);
390
+    }
391 391
 	
392
-	/**
393
-	 * @Given I log in with username :username and password :password
394
-	 */
395
-	public function iLogInWith($username, $password)
396
-	{
397
-		$repo = $this->getUserRepository();
398
-		$user = $repo->findByLogin($username);
399
-		$this->iWantToLogIn();
400
-		$this->iSpecifyTheUsernameAs($username);
401
-		$this->iSpecifyThePasswordAs($password);
402
-		$this->iLogIn();
403
-		$this->loggedInUser = $user;
404
-	}
392
+    /**
393
+     * @Given I log in with username :username and password :password
394
+     */
395
+    public function iLogInWith($username, $password)
396
+    {
397
+        $repo = $this->getUserRepository();
398
+        $user = $repo->findByLogin($username);
399
+        $this->iWantToLogIn();
400
+        $this->iSpecifyTheUsernameAs($username);
401
+        $this->iSpecifyThePasswordAs($password);
402
+        $this->iLogIn();
403
+        $this->loggedInUser = $user;
404
+    }
405 405
 	
406
-	/**
407
-	 * @When I go to profile page
408
-	 */
409
-	public function iGoToProfilePage()
410
-	{
411
-		$url = $this->buildUrl('lang/my');
412
-		$this->visit($url);
413
-	}
406
+    /**
407
+     * @When I go to profile page
408
+     */
409
+    public function iGoToProfilePage()
410
+    {
411
+        $url = $this->buildUrl('lang/my');
412
+        $this->visit($url);
413
+    }
414 414
 	
415
-	/**
416
-	 * @Given there is a user with the following:
417
-	 */
418
-	public function thereIsAUserWithTheFollowing(TableNode $table)
419
-	{
420
-		$repo = $this->getUserRepository();
421
-		$data = $table->getRowsHash();
422
-		$email = isset($data['email']) ? $data['email']:'[email protected]';
423
-		$password = isset($data['password']) ? $data['password']:'test';
424
-		$fullname = isset($data['fullname']) ? $data['fullname']:'Test User';
425
-		$role = isset($data['role']) ? $data['role']:User::ROLE_RECRUITER;
415
+    /**
416
+     * @Given there is a user with the following:
417
+     */
418
+    public function thereIsAUserWithTheFollowing(TableNode $table)
419
+    {
420
+        $repo = $this->getUserRepository();
421
+        $data = $table->getRowsHash();
422
+        $email = isset($data['email']) ? $data['email']:'[email protected]';
423
+        $password = isset($data['password']) ? $data['password']:'test';
424
+        $fullname = isset($data['fullname']) ? $data['fullname']:'Test User';
425
+        $role = isset($data['role']) ? $data['role']:User::ROLE_RECRUITER;
426 426
 		
427
-		if(!is_object($user=$repo->findByLogin($email))){
428
-			$user = $this->createUser($email,$password,$role,$fullname);
429
-		}
430
-		$this->currentUser = $user;
431
-		$this->addCreatedUser($user);
432
-	}
427
+        if(!is_object($user=$repo->findByLogin($email))){
428
+            $user = $this->createUser($email,$password,$role,$fullname);
429
+        }
430
+        $this->currentUser = $user;
431
+        $this->addCreatedUser($user);
432
+    }
433 433
 	
434
-	private function addCreatedUser(UserInterface $user)
435
-	{
436
-		if(!in_array($user,static::$users)){
437
-			static::$users[] = $user;
438
-		}
439
-	}
434
+    private function addCreatedUser(UserInterface $user)
435
+    {
436
+        if(!in_array($user,static::$users)){
437
+            static::$users[] = $user;
438
+        }
439
+    }
440 440
 	
441
-	/**
442
-	 * @When I want to change my password
443
-	 */
444
-	public function iWantToChangeMyPassword()
445
-	{
446
-		$url = $this->buildUrl('lang/my-password');
447
-		$this->visit($url);
448
-	}
441
+    /**
442
+     * @When I want to change my password
443
+     */
444
+    public function iWantToChangeMyPassword()
445
+    {
446
+        $url = $this->buildUrl('lang/my-password');
447
+        $this->visit($url);
448
+    }
449 449
 
450 450
     /**
451 451
      * @return User
452 452
      * @throws FailedExpectationException
453 453
      */
454
-	public function getCurrentUser()
454
+    public function getCurrentUser()
455 455
     {
456 456
         if(!$this->currentUser instanceof User){
457 457
             throw new FailedExpectationException('Need to login first before use this step');
Please login to merge, or discard this patch.
module/Core/src/Core/Controller/FileController.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -28,27 +28,27 @@
 block discarded – undo
28 28
  */
29 29
 class FileController extends AbstractActionController
30 30
 {
31
-	/**
32
-	 * @var RepositoryService
33
-	 */
34
-	private $repositories;
31
+    /**
32
+     * @var RepositoryService
33
+     */
34
+    private $repositories;
35 35
 	
36
-	/**
37
-	 * @var EventManager
38
-	 */
39
-	private $coreFileEvents;
36
+    /**
37
+     * @var EventManager
38
+     */
39
+    private $coreFileEvents;
40 40
 	
41
-	public function __construct(
42
-		RepositoryService $repositories,
43
-		EventManager $eventManager
44
-	)
45
-	{
46
-		$this->repositories = $repositories;
47
-		$this->coreFileEvents = $eventManager;
48
-	}
41
+    public function __construct(
42
+        RepositoryService $repositories,
43
+        EventManager $eventManager
44
+    )
45
+    {
46
+        $this->repositories = $repositories;
47
+        $this->coreFileEvents = $eventManager;
48
+    }
49 49
 	
50 50
 	
51
-	protected function attachDefaultListeners()
51
+    protected function attachDefaultListeners()
52 52
     {
53 53
         parent::attachDefaultListeners();
54 54
         $events = $this->getEventManager();
Please login to merge, or discard this patch.
module/Core/config/module.config.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -42,24 +42,24 @@  discard block
 block discarded – undo
42 42
     'log' => array(
43 43
         'Core/Log' => array(
44 44
             'writers' => array(
45
-                 array(
46
-                     'name' => 'stream',
45
+                    array(
46
+                        'name' => 'stream',
47 47
                     'priority' => 1000,
48 48
                     'options' => array(
49
-                         'stream' => __DIR__ .'/../../../log/yawik.log',
49
+                            'stream' => __DIR__ .'/../../../log/yawik.log',
50
+                    ),
50 51
                     ),
51
-                 ),
52 52
             ),
53 53
         ),
54 54
         'Log/Core/Mail' => array(
55 55
             'writers' => array(
56
-                 array(
57
-                     'name' => 'stream',
56
+                    array(
57
+                        'name' => 'stream',
58 58
                     'priority' => 1000,
59 59
                     'options' => array(
60
-                         'stream' => __DIR__ .'/../../../log/mails.log',
60
+                            'stream' => __DIR__ .'/../../../log/mails.log',
61
+                    ),
61 62
                     ),
62
-                 ),
63 63
             ),
64 64
         ),
65 65
     ),
@@ -290,12 +290,12 @@  discard block
 block discarded – undo
290 290
     ),
291 291
     // Configuration of the controller service manager (Which loads controllers)
292 292
     'controllers' => array(
293
-	    'factories' => [
294
-		    'Core/Index'   => LazyControllerFactory::class,
293
+        'factories' => [
294
+            'Core/Index'   => LazyControllerFactory::class,
295 295
             'Core/Admin'   => AdminControllerFactory::class,
296
-		    'Core/File'    => FileControllerFactory::class,
296
+            'Core/File'    => FileControllerFactory::class,
297 297
             'Core/Content' => LazyControllerFactory::class,
298
-	    ],
298
+        ],
299 299
     ),
300 300
     // Configuration of the controller plugin service manager
301 301
     'controller_plugins' => array(
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
             'paginatorservice' => 'Core/PaginatorService',
326 326
             'paginationParams' => 'Core/PaginationParams',
327 327
             'searchform'       => 'Core/SearchForm',
328
-	        'notification'     => 'Notification',
328
+            'notification'     => 'Notification',
329 329
         )
330 330
     ),
331 331
     // Configure the view service manager
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
         ),
424 424
         'aliases' => [
425 425
             'snippet' => \Core\View\Helper\Snippet::class,
426
-	        'ajaxUrl' => \Core\View\Helper\AjaxUrl::class,
426
+            'ajaxUrl' => \Core\View\Helper\AjaxUrl::class,
427 427
             'proxy' => \Core\View\Helper\Proxy::class,
428 428
             'form_element' => 'formElement',
429 429
         ],
@@ -521,17 +521,17 @@  discard block
 block discarded – undo
521 521
         ],
522 522
 
523 523
         'Core/Ajax/Events' => [
524
-	        'service' => 'Core/EventManager',
525
-	        'event'   => \Core\Listener\Events\AjaxEvent::class,
524
+            'service' => 'Core/EventManager',
525
+            'event'   => \Core\Listener\Events\AjaxEvent::class,
526 526
         ],
527 527
 	    
528
-	    'Core/File/Events' => [
529
-		    'service' => 'Core/EventManager',
530
-		    'event' => \Core\Listener\Events\FileEvent::class,
528
+        'Core/File/Events' => [
529
+            'service' => 'Core/EventManager',
530
+            'event' => \Core\Listener\Events\FileEvent::class,
531 531
             'listeners' => [
532 532
                 \Core\Listener\DeleteImageSetListener::class => [\Core\Listener\Events\FileEvent::EVENT_DELETE, -1000],
533 533
             ],
534
-	    ]
534
+        ]
535 535
     ],
536 536
     
537 537
 );
Please login to merge, or discard this patch.
src/Jobs/Factory/Controller/ApiJobListByOrganizationControllerFactory.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
                                 ['name' => 'StringTrim'],
41 41
                                 ['name' => 'Alpha'],
42 42
                             ],
43
-                          ]);
43
+                            ]);
44 44
 
45 45
         $controller = new ApiJobListByOrganizationController($jobRepository, $apiJobDehydrator, $inputFilter);
46 46
 
Please login to merge, or discard this patch.
module/Jobs/src/Jobs/Model/ApiJobDehydrator.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -22,11 +22,11 @@  discard block
 block discarded – undo
22 22
      */
23 23
     protected $url;
24 24
 
25
-  /**
26
-   * ViewHelper for generating an url to a job posting
27
-   *
28
-   * @var JobUrl $jobUrl
29
-   */
25
+    /**
26
+     * ViewHelper for generating an url to a job posting
27
+     *
28
+     * @var JobUrl $jobUrl
29
+     */
30 30
     protected $jobUrl;
31 31
 
32 32
     /**
@@ -40,11 +40,11 @@  discard block
 block discarded – undo
40 40
         return $this;
41 41
     }
42 42
 
43
-   /**
44
-    * @param JobUrl $url
45
-    *
46
-    * @return $this
47
-    */
43
+    /**
44
+     * @param JobUrl $url
45
+     *
46
+     * @return $this
47
+     */
48 48
     public function setJobUrl($url)
49 49
     {
50 50
         $this->jobUrl = $url;
@@ -64,8 +64,8 @@  discard block
 block discarded – undo
64 64
             'location' => $job->getLocation(),
65 65
             'link' => $this->jobUrl->__invoke(
66 66
                 $job,[
67
-                  'linkOnly'=> true,
68
-                  'absolute' => true,
67
+                    'linkOnly'=> true,
68
+                    'absolute' => true,
69 69
                 ]
70 70
             ),
71 71
             'organization' => array(
Please login to merge, or discard this patch.
module/Organizations/config/module.config.php 1 patch
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
     'controllers' => [
51 51
         'factories' => [
52
-	        'Organizations/InviteEmployee' => \Organizations\Factory\Controller\InviteEmployeeControllerFactory::class,
52
+            'Organizations/InviteEmployee' => \Organizations\Factory\Controller\InviteEmployeeControllerFactory::class,
53 53
             'Organizations/Index' => 'Organizations\Factory\Controller\IndexControllerFactory',
54 54
             'Organizations/Profile' => 'Organizations\Factory\Controller\ProfileControllerFactory'
55 55
         ]
@@ -66,14 +66,14 @@  discard block
 block discarded – undo
66 66
     'view_manager' => [
67 67
         // Map template to files. Speeds up the lookup through the template stack.
68 68
         'template_map' => [
69
-             'organizations/index/edit' => __DIR__ . '/../view/organizations/index/form.phtml',
70
-             'organizations/form/employees-fieldset' => __DIR__ . '/../view/form/employees-fieldset.phtml',
71
-             'organizations/form/employee-fieldset' => __DIR__ .'/../view/form/employee-fieldset.phtml',
72
-             'organizations/form/invite-employee-bar' => __DIR__ . '/../view/form/invite-employee-bar.phtml',
73
-             'organizations/error/no-parent' => __DIR__ . '/../view/error/no-parent.phtml',
74
-             'organizations/error/invite' => __DIR__ . '/../view/error/invite.phtml',
75
-             'organizations/mail/invite-employee' => __DIR__ . '/../view/mail/invite-employee.phtml',
76
-             'organizations/form/workflow-fieldset' => __DIR__ . '/../view/form/workflow-fieldset.phtml',
69
+                'organizations/index/edit' => __DIR__ . '/../view/organizations/index/form.phtml',
70
+                'organizations/form/employees-fieldset' => __DIR__ . '/../view/form/employees-fieldset.phtml',
71
+                'organizations/form/employee-fieldset' => __DIR__ .'/../view/form/employee-fieldset.phtml',
72
+                'organizations/form/invite-employee-bar' => __DIR__ . '/../view/form/invite-employee-bar.phtml',
73
+                'organizations/error/no-parent' => __DIR__ . '/../view/error/no-parent.phtml',
74
+                'organizations/error/invite' => __DIR__ . '/../view/error/invite.phtml',
75
+                'organizations/mail/invite-employee' => __DIR__ . '/../view/mail/invite-employee.phtml',
76
+                'organizations/form/workflow-fieldset' => __DIR__ . '/../view/form/workflow-fieldset.phtml',
77 77
             'organizations/profile/disabled' => __DIR__ . '/../view/organizations/profile/disabled.phtml',
78 78
         ],
79 79
         // Where to look for view templates not mapped above
@@ -83,24 +83,24 @@  discard block
 block discarded – undo
83 83
     ],
84 84
     'form_elements' => [
85 85
         'invokables' => [
86
-             'Organizations/Form' => 'Organizations\Form\Organizations',
87
-             'Organizations/OrganizationsContactForm'     => 'Organizations\Form\OrganizationsContactForm',
88
-             'Organizations/OrganizationsNameForm'        => 'Organizations\Form\OrganizationsNameForm',
89
-             'Organizations/OrganizationsDescriptionForm' => 'Organizations\Form\OrganizationsDescriptionForm',
90
-             'Organizations/OrganizationsContactFieldset' => 'Organizations\Form\OrganizationsContactFieldset',
91
-             'Organizations/OrganizationsDescriptionFieldset' => 'Organizations\Form\OrganizationsDescriptionFieldset',
92
-             //'Organizations/OrganizationFieldset'       => 'Organizations\Form\OrganizationFieldset',
93
-             'Organizations/EmployeesContainer'           => 'Organizations\Form\EmployeesContainer',
94
-             'Organizations/Employees'                    => 'Organizations\Form\Employees',
95
-             'Organizations/InviteEmployeeBar'            => 'Organizations\Form\Element\InviteEmployeeBar',
96
-             'Organizations/Employee'                     => 'Organizations\Form\Element\Employee',
97
-             'Organizations/WorkflowSettings'             => 'Organizations\Form\WorkflowSettings',
98
-             'Organizations/WorkflowSettingsFieldset'     => 'Organizations\Form\WorkflowSettingsFieldset',
99
-             'Organizations/Profile'                      => \Organizations\Form\OrganizationsProfileForm::class,
100
-             'Organizations/ProfileFieldset'              => \Organizations\Form\OrganizationsProfileFieldset::class
86
+                'Organizations/Form' => 'Organizations\Form\Organizations',
87
+                'Organizations/OrganizationsContactForm'     => 'Organizations\Form\OrganizationsContactForm',
88
+                'Organizations/OrganizationsNameForm'        => 'Organizations\Form\OrganizationsNameForm',
89
+                'Organizations/OrganizationsDescriptionForm' => 'Organizations\Form\OrganizationsDescriptionForm',
90
+                'Organizations/OrganizationsContactFieldset' => 'Organizations\Form\OrganizationsContactFieldset',
91
+                'Organizations/OrganizationsDescriptionFieldset' => 'Organizations\Form\OrganizationsDescriptionFieldset',
92
+                //'Organizations/OrganizationFieldset'       => 'Organizations\Form\OrganizationFieldset',
93
+                'Organizations/EmployeesContainer'           => 'Organizations\Form\EmployeesContainer',
94
+                'Organizations/Employees'                    => 'Organizations\Form\Employees',
95
+                'Organizations/InviteEmployeeBar'            => 'Organizations\Form\Element\InviteEmployeeBar',
96
+                'Organizations/Employee'                     => 'Organizations\Form\Element\Employee',
97
+                'Organizations/WorkflowSettings'             => 'Organizations\Form\WorkflowSettings',
98
+                'Organizations/WorkflowSettingsFieldset'     => 'Organizations\Form\WorkflowSettingsFieldset',
99
+                'Organizations/Profile'                      => \Organizations\Form\OrganizationsProfileForm::class,
100
+                'Organizations/ProfileFieldset'              => \Organizations\Form\OrganizationsProfileFieldset::class
101 101
         ],
102 102
         'factories' => [
103
-	        'Organizations/OrganizationsNameFieldset'    => \Organizations\Factory\Form\OrganizationsNameFieldsetFactory::class,
103
+            'Organizations/OrganizationsNameFieldset'    => \Organizations\Factory\Form\OrganizationsNameFieldsetFactory::class,
104 104
             'Organizations/Image'                        => \Organizations\Form\LogoImageFactory::class,
105 105
             'Organizations/EmployeesFieldset'            => 'Organizations\Factory\Form\EmployeesFieldsetFactory',
106 106
             'Organizations/EmployeeFieldset'             => 'Organizations\Factory\Form\EmployeeFieldsetFactory',
@@ -212,13 +212,13 @@  discard block
 block discarded – undo
212 212
 
213 213
     'service_manager' => [
214 214
         'invokables' => [
215
-           'Organizations\Auth\Dependency\EmployeeListListener' => 'Organizations\Auth\Dependency\EmployeeListListener'
215
+            'Organizations\Auth\Dependency\EmployeeListListener' => 'Organizations\Auth\Dependency\EmployeeListListener'
216 216
         ],
217 217
         'factories' => [
218
-           'Organizations\Auth\Dependency\ListListener' => 'Organizations\Factory\Auth\Dependency\ListListenerFactory',
219
-           'Organizations\ImageFileCache\Manager' => 'Organizations\Factory\ImageFileCache\ManagerFactory',
220
-           'Organizations\ImageFileCache\ODMListener' => 'Organizations\Factory\ImageFileCache\ODMListenerFactory',
221
-           'Organizations\ImageFileCache\ApplicationListener' => 'Organizations\Factory\ImageFileCache\ApplicationListenerFactory',
218
+            'Organizations\Auth\Dependency\ListListener' => 'Organizations\Factory\Auth\Dependency\ListListenerFactory',
219
+            'Organizations\ImageFileCache\Manager' => 'Organizations\Factory\ImageFileCache\ManagerFactory',
220
+            'Organizations\ImageFileCache\ODMListener' => 'Organizations\Factory\ImageFileCache\ODMListenerFactory',
221
+            'Organizations\ImageFileCache\ApplicationListener' => 'Organizations\Factory\ImageFileCache\ApplicationListenerFactory',
222 222
         ],
223 223
     ],
224 224
 
Please login to merge, or discard this patch.
module/Core/src/Core/Repository/SnapshotRepository.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
             'entity' => $snapshot
125 125
         ]);
126 126
         $this->dm->getEventManager()
127
-                 ->dispatchEvent(DoctrineMongoODM\Event\RepositoryEventsSubscriber::postCreate, $eventArgs);
127
+                    ->dispatchEvent(DoctrineMongoODM\Event\RepositoryEventsSubscriber::postCreate, $eventArgs);
128 128
 
129 129
         $this->copy($source, $snapshot);
130 130
 
@@ -200,12 +200,12 @@  discard block
 block discarded – undo
200 200
     public function findLatest($sourceId, $isDraft = false)
201 201
     {
202 202
         $entity = $this->createQueryBuilder()
203
-          ->field('snapshotEntity')->equals(new \MongoId($sourceId))
204
-          ->field('snapshotMeta.isDraft')->equals($isDraft)
205
-          ->sort('snapshotMeta.dateCreated.date', 'desc')
206
-          ->limit(1)
207
-          ->getQuery()
208
-          ->getSingleResult()
203
+            ->field('snapshotEntity')->equals(new \MongoId($sourceId))
204
+            ->field('snapshotMeta.isDraft')->equals($isDraft)
205
+            ->sort('snapshotMeta.dateCreated.date', 'desc')
206
+            ->limit(1)
207
+            ->getQuery()
208
+            ->getSingleResult()
209 209
         ;
210 210
         if ($entity) {
211 211
             $this->dm->getEventManager()->dispatchEvent(
Please login to merge, or discard this patch.
module/Organizations/src/Organizations/Repository/Organization.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -129,10 +129,10 @@  discard block
 block discarded – undo
129 129
 //           )
130 130
 //        );
131 131
         $qb->addAnd($qb->expr()->field('user')->equals($userId))
132
-           ->addAnd(
133
-               $qb->expr()->addOr($qb->expr()->field('parent')->exists(false))
134
-                               ->addOr($qb->expr()->field('parent')->equals(null))
135
-           );
132
+            ->addAnd(
133
+                $qb->expr()->addOr($qb->expr()->field('parent')->exists(false))
134
+                                ->addOr($qb->expr()->field('parent')->equals(null))
135
+            );
136 136
 
137 137
         $q      = $qb->getQuery();
138 138
         $entity = $q->getSingleResult();
@@ -192,11 +192,11 @@  discard block
 block discarded – undo
192 192
         return $c;
193 193
     }
194 194
 	
195
-	/**
196
-	 * @param array|null    $data
197
-	 * @param bool          $persist
198
-	 * @return \Organizations\Entity\Organization
199
-	 */
195
+    /**
196
+     * @param array|null    $data
197
+     * @param bool          $persist
198
+     * @return \Organizations\Entity\Organization
199
+     */
200 200
     public function create(array $data = null, $persist=false)
201 201
     {
202 202
         $entity = parent::create($data);
Please login to merge, or discard this patch.