| Conditions | 1 |
| Paths | 1 |
| Total Lines | 20 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | public function testJsonValidatorFunction() |
||
| 10 | { |
||
| 11 | $jsonValidator = $this->getMockBuilder('OldSound\RabbitMqBundle\RabbitMq\JsonValidator') |
||
| 12 | ->disableOriginalConstructor() |
||
| 13 | ->getMock(); |
||
| 14 | |||
| 15 | $jsonValidator->setSchema( |
||
| 16 | "OldSound\RabbitMqBundle\TestValidation/schema/JsonValidation.schema", |
||
| 17 | null, |
||
| 18 | ); |
||
| 19 | |||
| 20 | $json_msg = <<<'JSON' |
||
| 21 | { |
||
| 22 | "firstName": "John", |
||
| 23 | "lastName": "Doe", |
||
| 24 | "age": 21 |
||
| 25 | } |
||
| 26 | JSON; |
||
| 27 | $jsonValidator->method('getContentType')->willReturn('application/json'); |
||
| 28 | $this->assertEquals(null, $jsonValidator->validate($json_msg)); |
||
| 29 | |||
| 54 |