* Copyright 2005-2007, Cake Software Foundation, Inc. * 1785 E. Sahara Avenue, Suite 490-204 * Las Vegas, Nevada 89104 * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource * @copyright Copyright 2005-2007, Cake Software Foundation, Inc. * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake.tests * @subpackage cake.tests.cases.libs.view.helpers * @since CakePHP(tm) v 1.2.0.4206 * @version $Revision$ * @modifiedby $LastChangedBy$ * @lastmodified $Date$ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) { define('CAKEPHP_UNIT_TEST_EXECUTION', 1); } uses('view'.DS.'helpers'.DS.'app_helper', 'controller'.DS.'controller', 'model'.DS.'model', 'view'.DS.'helper', 'view'.DS.'helpers'.DS.'time'); /** * Short description for class. * * @package cake.tests * @subpackage cake.tests.cases.libs.view.helpers */ class TimeTest extends UnitTestCase { function skip() { $this->skipif (false, 'TimeHelper test not implemented'); } function setUp() { $this->Time = new TimeHelper(); } function testToQuarter() { $result = $this->Time->toQuarter('2007-12-25'); $this->assertEqual($result, 4); $result = $this->Time->toQuarter('2007-9-25'); $this->assertEqual($result, 3); $result = $this->Time->toQuarter('2007-3-25'); $this->assertEqual($result, 1); $result = $this->Time->toQuarter('2007-3-25', true); $this->assertEqual($result, array('2007-01-01', '2007-03-31')); } function tearDown() { unset($this->Time); } } ?>