mirror of
https://github.com/Respect/Validation.git
synced 2024-06-07 08:12:16 +02:00
Rename rule "Resource" to "ResourceType"
This commit is contained in:
parent
598bfa2843
commit
88865267d9
|
@ -15,7 +15,7 @@ All notable changes of the Respect\Validation releases are documented in this fi
|
|||
- Create "KeySet" rule (#374)
|
||||
- Create "Mimetype" rule (#361)
|
||||
- Create "Optional" rule (#423)
|
||||
- Create "Resource" rule (#397)
|
||||
- Create "ResourceType" rule (#397)
|
||||
- Create "Scalar" rule (#397)
|
||||
- Create "Size" rule (#359)
|
||||
- Create "SubdivisionCode" rule for 252 countries (#411)
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# Resource
|
||||
# ResourceType
|
||||
|
||||
- `v::resource()`
|
||||
- `v::resourceType()`
|
||||
|
||||
Validates if the input is a resource.
|
||||
|
||||
```php
|
||||
v::resource()->validate(fopen('/path/to/file.txt', 'w')); //true
|
||||
v::resourceType()->validate(fopen('/path/to/file.txt', 'w')); //true
|
||||
```
|
||||
|
||||
***
|
|
@ -22,6 +22,6 @@ See also:
|
|||
* [Instance](Instance.md)
|
||||
* [IntVal](IntVal.md)
|
||||
* [ObjectType](ObjectType.md)
|
||||
* [Resource](Resource.md)
|
||||
* [ResourceType](ResourceType.md)
|
||||
* [Scalar](Scalar.md)
|
||||
* [StringType](StringType.md)
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* [NullType](NullType.md)
|
||||
* [Numeric](Numeric.md)
|
||||
* [ObjectType](ObjectType.md)
|
||||
* [Resource](Resource.md)
|
||||
* [ResourceType](ResourceType.md)
|
||||
* [Scalar](Scalar.md)
|
||||
* [StringType](StringType.md)
|
||||
* [TrueVal](TrueVal.md)
|
||||
|
@ -81,7 +81,7 @@
|
|||
* [Prnt](Prnt.md)
|
||||
* [Punct](Punct.md)
|
||||
* [Regex](Regex.md)
|
||||
* [Resource](Resource.md)
|
||||
* [ResourceType](ResourceType.md)
|
||||
* [Slug](Slug.md)
|
||||
* [Space](Space.md)
|
||||
* [StartsWith](StartsWith.md)
|
||||
|
@ -261,7 +261,7 @@
|
|||
* [Punct](Punct.md)
|
||||
* [Readable](Readable.md)
|
||||
* [Regex](Regex.md)
|
||||
* [Resource](Resource.md)
|
||||
* [ResourceType](ResourceType.md)
|
||||
* [Roman](Roman.md)
|
||||
* [Scalar](Scalar.md)
|
||||
* [Sf](Sf.md)
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace Respect\Validation\Exceptions;
|
|||
/**
|
||||
* @author Henrique Moody <henriquemoody@gmail.com>
|
||||
*/
|
||||
class ResourceException extends ValidationException
|
||||
class ResourceTypeException extends ValidationException
|
||||
{
|
||||
/**
|
||||
* @var array
|
|
@ -14,7 +14,7 @@ namespace Respect\Validation\Rules;
|
|||
/**
|
||||
* @author Henrique Moody <henriquemoody@gmail.com>
|
||||
*/
|
||||
class Resource extends AbstractRule
|
||||
class ResourceType extends AbstractRule
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
|
@ -102,7 +102,7 @@ use Respect\Validation\Rules\Key;
|
|||
* @method static Validator punct(string $additionalChars = null)
|
||||
* @method static Validator readable()
|
||||
* @method static Validator regex(string $regex)
|
||||
* @method static Validator resource()
|
||||
* @method static Validator resourceType()
|
||||
* @method static Validator roman()
|
||||
* @method static Validator scalar()
|
||||
* @method static Validator sf(string $name, array $params = null)
|
||||
|
|
|
@ -13,16 +13,16 @@ namespace Respect\Validation\Rules;
|
|||
|
||||
/**
|
||||
* @group rule
|
||||
* @covers Respect\Validation\Rules\Resource
|
||||
* @covers Respect\Validation\Exceptions\ResourceException
|
||||
* @covers Respect\Validation\Rules\ResourceType
|
||||
* @covers Respect\Validation\Exceptions\ResourceTypeException
|
||||
*/
|
||||
class ResourceTest extends \PHPUnit_Framework_TestCase
|
||||
class ResourceTypeTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $rule;
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
$this->rule = new Resource();
|
||||
$this->rule = new ResourceType();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -42,7 +42,7 @@ class ResourceTest extends \PHPUnit_Framework_TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* @expectedException Respect\Validation\Exceptions\ResourceException
|
||||
* @expectedException Respect\Validation\Exceptions\ResourceTypeException
|
||||
* @expectedExceptionMessage "Something" must be a resource
|
||||
*/
|
||||
public function testShouldThrowResourceExceptionWhenChecking()
|
Loading…
Reference in a new issue