File tree 3 files changed +12
-6
lines changed 3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 7
7
8
8
require ".config " ;
9
9
10
- $ trello = new Trello ($ key , $ token );
10
+ $ client = new Trello \Client ();
11
+ $ client ->authenticate ($ key , $ token , Client::AUTH_URL_CLIENT_ID );
12
+
13
+ $ trello = new Trello ($ client );
11
14
$ models = $ trello ->getTeams ();
12
15
13
16
print_r ($ models );
Original file line number Diff line number Diff line change @@ -14,10 +14,8 @@ class Trello
14
14
{
15
15
private $ client ;
16
16
17
- public function __construct ($ key , $ token )
17
+ public function __construct (Client $ client )
18
18
{
19
- $ client = new Client ();
20
- $ client ->authenticate ($ key , $ token , Client::AUTH_URL_CLIENT_ID );
21
19
$ this ->client = $ client ;
22
20
}
23
21
Original file line number Diff line number Diff line change 2
2
require "vendor/autoload.php " ;
3
3
4
4
use \Webhooks \Wrapper \Trello ;
5
+ use \Webhooks \Wrapper \Trello \Client ;
5
6
6
7
class TrelloTest extends \PHPUnit \Framework \TestCase
7
8
{
@@ -13,14 +14,18 @@ public function init($msg = "")
13
14
{
14
15
if (null == $ this ->trello ) {
15
16
require ".config " ;
16
- $ this ->trello = new \Webhooks \Wrapper \Trello ($ key , $ token );
17
+ $ client = new Client ();
18
+ $ client ->authenticate ($ key , $ token , Client::AUTH_URL_CLIENT_ID );
19
+ $ this ->trello = new \Webhooks \Wrapper \Trello ($ client );
17
20
}
18
21
}
19
22
20
23
public function testInit ()
21
24
{
22
25
require ".config " ;
23
- $ trello = new \Webhooks \Wrapper \Trello ($ key , $ token );
26
+ $ client = new Client ();
27
+ $ client ->authenticate ($ key , $ token , Client::AUTH_URL_CLIENT_ID );
28
+ $ trello = new \Webhooks \Wrapper \Trello ($ client );
24
29
$ this ->assertTrue (true );
25
30
return $ trello ;
26
31
}
You can’t perform that action at this time.
0 commit comments