[ZF-10089] Zend_Log
[zend/radio.git] / tests / Zend / Validate / GreaterThanTest.php
blobaa353ac4cc42b92eae2e195978d84f543b9cdb49
1 <?php
2 /**
3 * Zend Framework
5 * LICENSE
7 * This source file is subject to the new BSD license that is bundled
8 * with this package in the file LICENSE.txt.
9 * It is also available through the world-wide-web at this URL:
10 * http://framework.zend.com/license/new-bsd
11 * If you did not receive a copy of the license and are unable to
12 * obtain it through the world-wide-web, please send an email
13 * to license@zend.com so we can send you a copy immediately.
15 * @category Zend
16 * @package Zend_Validate
17 * @subpackage UnitTests
18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
20 * @version $Id$
24 /**
25 * Test helper
27 require_once dirname(__FILE__) . '/../../TestHelper.php';
29 /**
30 * @see Zend_Validate_GreaterThan
32 require_once 'Zend/Validate/GreaterThan.php';
35 /**
36 * @category Zend
37 * @package Zend_Validate
38 * @subpackage UnitTests
39 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
40 * @license http://framework.zend.com/license/new-bsd New BSD License
41 * @group Zend_Validate
43 class Zend_Validate_GreaterThanTest extends PHPUnit_Framework_TestCase
45 /**
46 * Ensures that the validator follows expected behavior
48 * @return void
50 public function testBasic()
52 /**
53 * The elements of each array are, in order:
54 * - minimum
55 * - expected validation result
56 * - array of test input values
58 $valuesExpected = array(
59 array(0, true, array(0.01, 1, 100)),
60 array(0, false, array(0, 0.00, -0.01, -1, -100)),
61 array('a', true, array('b', 'c', 'd')),
62 array('z', false, array('x', 'y', 'z'))
64 foreach ($valuesExpected as $element) {
65 $validator = new Zend_Validate_GreaterThan($element[0]);
66 foreach ($element[2] as $input) {
67 $this->assertEquals($element[1], $validator->isValid($input));
72 /**
73 * Ensures that getMessages() returns expected default value
75 * @return void
77 public function testGetMessages()
79 $validator = new Zend_Validate_GreaterThan(10);
80 $this->assertEquals(array(), $validator->getMessages());
83 /**
84 * Ensures that getMin() returns expected value
86 * @return void
88 public function testGetMin()
90 $validator = new Zend_Validate_GreaterThan(10);
91 $this->assertEquals(10, $validator->getMin());