File tree Expand file tree Collapse file tree 3 files changed +46
-3
lines changed Expand file tree Collapse file tree 3 files changed +46
-3
lines changed Original file line number Diff line number Diff line change 13
13
"require" : {
14
14
"php" : " >=5.5.9" ,
15
15
"illuminate/support" : " 5.2.*" ,
16
+ "illuminate/container" : " 5.2.*" ,
16
17
"guzzlehttp/guzzle" : " ~5.0"
17
18
},
18
19
"require-dev" : {
19
20
"phpunit/phpunit" : " 4.*" ,
20
21
"scrutinizer/ocular" : " ~1.1" ,
21
- "satooshi/php-coveralls" : " ^0.7.0"
22
+ "satooshi/php-coveralls" : " ^0.7.0" ,
23
+ "mockery/mockery" : " >=0.7.2"
22
24
},
23
25
"autoload" : {
24
26
"psr-4" : {
Original file line number Diff line number Diff line change 12
12
namespace Unicodeveloper \Paystack ;
13
13
14
14
use GuzzleHttp \Client ;
15
+ use Illuminate \Support \Facades \Config ;
15
16
16
17
class Paystack {
17
18
@@ -67,7 +68,7 @@ public function __construct()
67
68
*/
68
69
public function setBaseUrl ()
69
70
{
70
- $ this ->baseUrl = config ('paystack.paymentUrl ' );
71
+ $ this ->baseUrl = Config:: get ('paystack.paymentUrl ' );
71
72
}
72
73
73
74
/**
@@ -76,7 +77,7 @@ public function setBaseUrl()
76
77
*/
77
78
public function setKey ()
78
79
{
79
- $ this ->secretKey = config ('paystack.secretKey ' );
80
+ $ this ->secretKey = Config:: get ('paystack.secretKey ' );
80
81
}
81
82
82
83
/**
Original file line number Diff line number Diff line change 11
11
12
12
namespace Unicodeveloper \Paystack \Test ;
13
13
14
+ use Mockery as m ;
15
+ use GuzzleHttp \Client ;
14
16
use PHPUnit_Framework_TestCase ;
15
17
use Unicodeveloper \Paystack \Paystack ;
18
+ use Illuminate \Support \Facades \Config ;
19
+ use Illuminate \Support \Facades \Facade as Facade ;
16
20
17
21
class PaystackTest extends PHPUnit_Framework_TestCase
18
22
{
23
+ protected $ paystack ;
24
+
25
+ public function setUp ()
26
+ {
27
+ $ this ->paystack = m::mock ('Unicodeveloper\Paystack\Paystack ' );
28
+ $ this ->mock = m::mock ('GuzzleHttp\Client ' );
29
+ }
30
+
31
+ public function tearDown ()
32
+ {
33
+ m::close ();
34
+ }
35
+
36
+ public function testAllCustomersAreReturned ()
37
+ {
38
+ $ array = $ this ->paystack ->shouldReceive ('getAllCustomers ' )->andReturn (['prosper ' ]);
39
+
40
+ $ this ->assertEquals ('array ' , gettype (array ($ array )));
41
+ }
42
+
43
+ public function testAllTransactionsAreReturned ()
44
+ {
45
+ $ array = $ this ->paystack ->shouldReceive ('getAllTransactions ' )->andReturn (['transactions ' ]);
46
+
47
+ $ this ->assertEquals ('array ' , gettype (array ($ array )));
48
+ }
49
+
50
+ public function testAllPlansAreReturned ()
51
+ {
52
+ $ array = $ this ->paystack ->shouldReceive ('getAllPlans ' )->andReturn (['intermediate-plan ' ]);
53
+
54
+ $ this ->assertEquals ('array ' , gettype (array ($ array )));
55
+ }
56
+
57
+
58
+
19
59
20
60
}
You can’t perform that action at this time.
0 commit comments