| @@ 52-64 (lines=13) @@ | ||
| 49 | /** |
|
| 50 | * @expectedException \yii\web\ForbiddenHttpException |
|
| 51 | */ |
|
| 52 | public function testInvalid() |
|
| 53 | { |
|
| 54 | $_POST = [ |
|
| 55 | '_method' => 'POST', |
|
| 56 | 'data' => '100000|VND|0963465816|1|74132', |
|
| 57 | 'signature' => '1d31c0779f47e2bc3bfe40becf1fda0d7e881aeb90d8efb0341e258692cf896aa' |
|
| 58 | ]; |
|
| 59 | ||
| 60 | return (new VerifyFilter([ |
|
| 61 | 'gateway' => $this->gateway, |
|
| 62 | 'command' => 'IPN' |
|
| 63 | ]))->beforeAction(null); |
|
| 64 | } |
|
| 65 | ||
| 66 | /** |
|
| 67 | * @depends testMissingCommand |
|
| @@ 71-85 (lines=15) @@ | ||
| 68 | * @depends testMissingGateway |
|
| 69 | * @depends testInvalid |
|
| 70 | */ |
|
| 71 | public function test() |
|
| 72 | { |
|
| 73 | $_POST = [ |
|
| 74 | '_method' => 'POST', |
|
| 75 | 'data' => '100000|VND|0963465816|1|74132', |
|
| 76 | 'signature' => '1d31c0779f47e2bc3bfe40becf1fda0d7e881aeb90d8efb0341e258692cf896a' |
|
| 77 | ]; |
|
| 78 | ||
| 79 | $result = (new VerifyFilter([ |
|
| 80 | 'gateway' => $this->gateway, |
|
| 81 | 'command' => 'IPN' |
|
| 82 | ]))->beforeAction(null); |
|
| 83 | ||
| 84 | $this->assertTrue($result); |
|
| 85 | } |
|
| 86 | ||
| 87 | ||
| 88 | ||