- Timestamp:
- 11/18/2016 07:32:03 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-schema-sanitization.php
r39222 r39296 64 64 $this->assertEquals( 'a@b.c', rest_sanitize_value_from_schema( 'a@b.c', $schema ) ); 65 65 $this->assertEquals( 'invalid', rest_sanitize_value_from_schema( 'invalid', $schema ) ); 66 } 67 68 public function test_format_ip() { 69 $schema = array( 70 'type' => 'string', 71 'format' => 'ip', 72 ); 73 74 $this->assertEquals( '127.0.0.1', rest_sanitize_value_from_schema( '127.0.0.1', $schema ) ); 75 $this->assertEquals( 'hello', rest_sanitize_value_from_schema( 'hello', $schema ) ); 76 $this->assertEquals( '2001:DB8:0:0:8:800:200C:417A', rest_sanitize_value_from_schema( '2001:DB8:0:0:8:800:200C:417A', $schema ) ); 66 77 } 67 78
Note: See TracChangeset
for help on using the changeset viewer.