| @@ 10-32 (lines=23) @@ | ||
| 7 | /** |
|
| 8 | * @group unit |
|
| 9 | */ |
|
| 10 | class CancelSubscriptionMessageTest extends \PHPUnit_Framework_TestCase |
|
| 11 | { |
|
| 12 | protected $request = array( |
|
| 13 | 'notification_type' => 'cancel_subscription', |
|
| 14 | 'user' => array( |
|
| 15 | 'id' => '1234567', |
|
| 16 | 'name' => 'Xsolla User', |
|
| 17 | ), |
|
| 18 | 'subscription' => array( |
|
| 19 | 'plan_id' => 1, |
|
| 20 | 'subscription_id' => '10', |
|
| 21 | 'product_id' => 'Demo Product', |
|
| 22 | 'date_create' => '2014-09-22T19:25:25+04:00', |
|
| 23 | 'date_end' => '2015-01-22T19:25:25+04:00', |
|
| 24 | ), |
|
| 25 | ); |
|
| 26 | ||
| 27 | public function test() |
|
| 28 | { |
|
| 29 | $message = new CancelSubscriptionMessage($this->request); |
|
| 30 | static::assertSame($this->request['subscription'], $message->getSubscription()); |
|
| 31 | } |
|
| 32 | } |
|
| 33 | ||
| @@ 10-32 (lines=23) @@ | ||
| 7 | /** |
|
| 8 | * @group unit |
|
| 9 | */ |
|
| 10 | class UpdateSubscriptionMessageTest extends \PHPUnit_Framework_TestCase |
|
| 11 | { |
|
| 12 | protected $request = array( |
|
| 13 | 'notification_type' => 'update_subscription', |
|
| 14 | 'user' => array( |
|
| 15 | 'id' => '1234567', |
|
| 16 | 'name' => 'Xsolla User', |
|
| 17 | ), |
|
| 18 | 'subscription' => array( |
|
| 19 | 'plan_id' => 1, |
|
| 20 | 'subscription_id' => '10', |
|
| 21 | 'product_id' => 'Demo Product', |
|
| 22 | 'date_create' => '2014-09-22T19:25:25+04:00', |
|
| 23 | 'date_end' => '2015-01-22T19:25:25+04:00', |
|
| 24 | ), |
|
| 25 | ); |
|
| 26 | ||
| 27 | public function test() |
|
| 28 | { |
|
| 29 | $message = new UpdateSubscriptionMessage($this->request); |
|
| 30 | static::assertSame($this->request['subscription'], $message->getSubscription()); |
|
| 31 | } |
|
| 32 | } |
|
| 33 | ||