This repository was archived by the owner on Sep 5, 2017. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-13
lines changed Expand file tree Collapse file tree 2 files changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -41,12 +41,12 @@ public function handle()
41
41
{
42
42
$ org = Org::findOrFail ($ this ->argument ('org ' ));
43
43
Github::authenticate ($ org ->user ->token , null , 'http_token ' );
44
- if (config ('app.env ' ) != 'testing ' ){
45
- if (isset ($ org ->team )) {
46
- Github::api ('teams ' )->addMember ($ org ->team ->id , $ this ->argument ('username ' ));
47
- } else {
48
- Github::api ('organization ' )->members ()->add ($ org ->name , $ this ->argument ('username ' ));
49
- }
44
+ if (config ('app.env ' ) != 'testing ' ) {
45
+ if (isset ($ org ->team )) {
46
+ Github::api ('teams ' )->addMember ($ org ->team ->id , $ this ->argument ('username ' ));
47
+ } else {
48
+ Github::api ('organization ' )->members ()->add ($ org ->name , $ this ->argument ('username ' ));
49
+ }
50
50
}
51
51
$ org ->invitecount ++;
52
52
$ org ->save ();
Original file line number Diff line number Diff line change 2
2
3
3
namespace Tests \Unit ;
4
4
5
- use Tests \ TestCase ;
5
+ use Github ;
6
6
use App \Org ;
7
7
use App \User ;
8
+ use Tests \TestCase ;
8
9
use Illuminate \Support \Facades \Artisan ;
9
- use Github ;
10
10
use Illuminate \Foundation \Testing \DatabaseTransactions ;
11
11
12
12
class JoinTest extends TestCase
13
13
{
14
14
use DatabaseTransactions;
15
+
15
16
/**
16
17
* A basic test example.
17
18
*
18
19
* @return void
19
20
*/
20
21
public function testJoinCommand ()
21
22
{
22
- $ user = factory (User::class)->create ();
23
- $ org = factory (Org::class)->create ([
23
+ $ user = factory (User::class)->create ();
24
+ $ org = factory (Org::class)->create ([
24
25
'userid ' => $ user ->id ,
25
26
]);
26
- Github::shouldReceive ('authenticate ' )
27
+ Github::shouldReceive ('authenticate ' )
27
28
->once ()
28
29
->with ($ org ->user ->token , null , 'http_token ' )
29
30
->andReturn ();
30
- Artisan::call ('orgmanager:joinorg ' , [
31
+ Artisan::call ('orgmanager:joinorg ' , [
31
32
'org ' => $ org ->id ,
32
33
'username ' => $ user ->github_username ,
33
34
]);
34
- $ this ->assertEquals ($ user ->github_username .' was invited to ' .$ org ->name ."\n" , Artisan::output ());
35
+ $ this ->assertEquals ($ user ->github_username .' was invited to ' .$ org ->name ."\n" , Artisan::output ());
35
36
}
36
37
}
You can’t perform that action at this time.
0 commit comments