WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/13/2017 04:37:03 AM (3 years ago)
Author:
SergeyBiryukov
Message:

REST API: Improve error messages for number relational validation.

Props jblz.
Fixes #39054.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-schema-validation.php

    r39296 r39896  
    2020        $this->assertTrue( rest_validate_value_from_schema( 1, $schema ) );
    2121        $this->assertTrue( rest_validate_value_from_schema( 2, $schema ) );
     22        $this->assertWPError( rest_validate_value_from_schema( 0.9, $schema ) );
    2223        $this->assertWPError( rest_validate_value_from_schema( 3, $schema ) );
    2324        $this->assertWPError( rest_validate_value_from_schema( true, $schema ) );
     
    3233        $this->assertTrue( rest_validate_value_from_schema( 1, $schema ) );
    3334        $this->assertTrue( rest_validate_value_from_schema( 2, $schema ) );
     35        $this->assertWPError( rest_validate_value_from_schema( 0, $schema ) );
    3436        $this->assertWPError( rest_validate_value_from_schema( 3, $schema ) );
    3537        $this->assertWPError( rest_validate_value_from_schema( 1.1, $schema ) );
Note: See TracChangeset for help on using the changeset viewer.