| @@ 46-57 (lines=12) @@ | ||
| 43 | * @depends testSignStatusWaiting |
|
| 44 | * @params Sign\MobileResult $result |
|
| 45 | */ |
|
| 46 | public function testSignStatusOk(Sign\MobileResult $result) |
|
| 47 | { |
|
| 48 | sleep(TIMEOUT); |
|
| 49 | ||
| 50 | /** @var Isign\Login\MobileStatusResult $result */ |
|
| 51 | $statusResult = $this->client->get( |
|
| 52 | new Sign\MobileStatus($result->getToken()) |
|
| 53 | ); |
|
| 54 | $this->assertSame(ResultInterface::STATUS_OK, $statusResult->getStatus()); |
|
| 55 | $this->assertSame('Signature1', $statusResult->getSignatureId()); |
|
| 56 | $this->assertNotEmpty($statusResult->getFile()); |
|
| 57 | } |
|
| 58 | ||
| 59 | /** |
|
| 60 | * Test parameters validation on client side |
|
| @@ 52-59 (lines=8) @@ | ||
| 49 | * |
|
| 50 | * @param ScPrepareResult $result |
|
| 51 | */ |
|
| 52 | public function testSign(ScPrepareResult $result) |
|
| 53 | { |
|
| 54 | $result = $this->client->get(new Sc($result->getToken(), $this->sign($result->getDtbs(), PRIVATE_KEY_SIGN))); |
|
| 55 | ||
| 56 | $this->assertSame(ResultInterface::STATUS_OK, $result->getStatus()); |
|
| 57 | $this->assertSame('Signature1', $result->getSignatureId()); |
|
| 58 | $this->assertNotEmpty($result->getFile()); |
|
| 59 | } |
|
| 60 | ||
| 61 | /** |
|
| 62 | * Test parameters validation on API by sending invalid personal code |
|
| @@ 9-23 (lines=15) @@ | ||
| 6 | ||
| 7 | class SealTest extends TestCase |
|
| 8 | { |
|
| 9 | public function testSign() |
|
| 10 | { |
|
| 11 | /** @var Isign\Document\SealResult $result */ |
|
| 12 | $result = $this->client->get(new Document\Seal( |
|
| 13 | 'pdf', |
|
| 14 | $this->getDocumentParams(), |
|
| 15 | false |
|
| 16 | )); |
|
| 17 | ||
| 18 | $this->assertSame(ResultInterface::STATUS_OK, $result->getStatus()); |
|
| 19 | $this->assertSame('Signature1', $result->getSignatureId()); |
|
| 20 | $this->assertNotEmpty($result->getFile()); |
|
| 21 | ||
| 22 | return $result; |
|
| 23 | } |
|
| 24 | ||
| 25 | private function getDocumentParams() |
|
| 26 | { |
|