@@ 34-44 (lines=11) @@ | ||
31 | )); |
|
32 | } |
|
33 | ||
34 | public function test_validate_schema_type_integer() { |
|
35 | ||
36 | $this->assertTrue( |
|
37 | rest_validate_request_arg( '123', $this->request, 'someinteger' ) |
|
38 | ); |
|
39 | ||
40 | $this->assertErrorResponse( |
|
41 | 'rest_invalid_param', |
|
42 | rest_validate_request_arg( 'abc', $this->request, 'someinteger' ) |
|
43 | ); |
|
44 | } |
|
45 | ||
46 | public function test_validate_schema_type_boolean() { |
|
47 | ||
@@ 65-75 (lines=11) @@ | ||
62 | ); |
|
63 | } |
|
64 | ||
65 | public function test_validate_schema_type_string() { |
|
66 | ||
67 | $this->assertTrue( |
|
68 | rest_validate_request_arg( '123', $this->request, 'somestring' ) |
|
69 | ); |
|
70 | ||
71 | $this->assertErrorResponse( |
|
72 | 'rest_invalid_param', |
|
73 | rest_validate_request_arg( array( 'foo' => 'bar' ), $this->request, 'somestring' ) |
|
74 | ); |
|
75 | } |
|
76 | ||
77 | public function test_validate_schema_enum() { |
|
78 |