1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?php
- namespace JsonSchema\Tests;
- class DisallowTest extends BaseTestCase
- {
- public function getInvalidTests()
- {
- return array(
- array(
- '{
- "value":" The xpto is weird"
- }',
- '{
- "type":"object",
- "properties":{
- "value":{
- "type":"any",
- "disallow":{"type":"string","pattern":"xpto"}
- }
- }
- }'
- ),
- array(
- '{
- "value":null
- }',
- '{
- "type":"object",
- "properties":{
- "value":{
- "type":"any",
- "disallow":{"type":"null"}
- }
- }
- }'
- )
- );
- }
- public function getValidTests()
- {
- return array(
- array(
- '{
- "value":" The xpto is weird"
- }',
- '{
- "type":"object",
- "properties":{
- "value":{
- "type":"any",
- "disallow":{"type":"string","pattern":"^xpto"}
- }
- }
- }'
- ),
- array(
- '{
- "value":1
- }',
- '{
- "type":"object",
- "properties":{
- "value":{
- "type":"any",
- "disallow":{"type":"null"}
- }
- }
- }'
- )
- );
- }
- }
|