PHP Classes

File: tests/src/Melody/Validation/Constraints/MinTest.php

Recommend this page to a friend!
  Classes of Marcelo Santos   Melody Validation   tests/src/Melody/Validation/Constraints/MinTest.php   Download  
File: tests/src/Melody/Validation/Constraints/MinTest.php
Role: Unit test script
Content type: text/plain
Description: Unit test script
Class: Melody Validation
Validate values according to many types of rules
Author: By
Last change:
Date: 11 years ago
Size: 624 bytes
 

Contents

Class file image Download
<?php

namespace Melody\Validation\Constraints;

use
Melody\Validation\Validator as v;

class
MinTest extends \PHPUnit_Framework_TestCase
{

    public function
test_valid_min_number_should_pass()
    {
       
$this->assertTrue(v::min(5)->validate(7));
    }

    public function
test_invalid_min_number_should_fail_validation()
    {
       
$this->assertFalse(v::min(5)->validate(4));
    }

    public function
test_not_string_argument_exception()
    {
       
$this->setExpectedException('InvalidArgumentException');
       
$this->assertInstanceOf('InvalidArgumentException', v::min(5)->validate(null));
    }

}