| @@ 33-51 (lines=19) @@ | ||
| 30 | */ |
|
| 31 | class ChaincodeProposalPayloadFactoryTest extends TestCase |
|
| 32 | { |
|
| 33 | public function testFromChaincodeInvocationSpec() |
|
| 34 | { |
|
| 35 | $chaincodeInvocationSpec = ChaincodeInvocationSpecFactory::fromArgs([ |
|
| 36 | 'foo', |
|
| 37 | 'bar', |
|
| 38 | ]); |
|
| 39 | ||
| 40 | $result = ChaincodeProposalPayloadFactory::fromChaincodeInvocationSpec($chaincodeInvocationSpec); |
|
| 41 | ||
| 42 | self::assertInstanceOf(ChaincodeProposalPayload::class, $result); |
|
| 43 | $expected = <<<'TAG' |
|
| 44 | ||
| 45 | ||
| 46 | ||
| 47 | foo |
|
| 48 | bar |
|
| 49 | TAG; |
|
| 50 | self::assertSame($expected, $result->getInput()); |
|
| 51 | } |
|
| 52 | ||
| 53 | public function testFromChaincodeInvocationSpecArgs() |
|
| 54 | { |
|
| @@ 53-69 (lines=17) @@ | ||
| 50 | self::assertSame($expected, $result->getInput()); |
|
| 51 | } |
|
| 52 | ||
| 53 | public function testFromChaincodeInvocationSpecArgs() |
|
| 54 | { |
|
| 55 | $result = ChaincodeProposalPayloadFactory::fromChaincodeInvocationSpecArgs([ |
|
| 56 | 'foo', |
|
| 57 | 'bar', |
|
| 58 | ]); |
|
| 59 | ||
| 60 | self::assertInstanceOf(ChaincodeProposalPayload::class, $result); |
|
| 61 | $expected = <<<'TAG' |
|
| 62 | ||
| 63 | ||
| 64 | ||
| 65 | foo |
|
| 66 | bar |
|
| 67 | TAG; |
|
| 68 | self::assertSame($expected, $result->getInput()); |
|
| 69 | } |
|
| 70 | } |
|
| 71 | ||