mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-16 03:48:24 +00:00
66bfa5631a
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5701 3807eeeb-6ff5-0310-8944-8be069107fe0
93 lines
No EOL
2 KiB
PHP
93 lines
No EOL
2 KiB
PHP
<?php
|
|
/* SVN FILE: $Id$ */
|
|
/**
|
|
* DboMysql test
|
|
*
|
|
* PHP versions 4 and 5
|
|
*
|
|
* CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
|
|
* Copyright 2005-2007, Cake Software Foundation, Inc.
|
|
* 1785 E. Sahara Avenue, Suite 490-204
|
|
* Las Vegas, Nevada 89104
|
|
*
|
|
* Licensed under The MIT License
|
|
* Redistributions of files must retain the above copyright notice.
|
|
*
|
|
* @filesource
|
|
* @copyright Copyright 2005-2007, Cake Software Foundation, Inc.
|
|
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
* @package cake
|
|
* @subpackage cake.cake.libs
|
|
* @since CakePHP(tm) v 1.2.0
|
|
* @version $Revision$
|
|
* @modifiedby $LastChangedBy$
|
|
* @lastmodified $Date$
|
|
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
*/
|
|
|
|
uses('model' . DS . 'datasources' . DS . 'dbo_source',
|
|
'model' . DS . 'datasources' . DS . 'dbo' . DS . 'dbo_mysql');
|
|
/**
|
|
* The test class for the DboMysql
|
|
*
|
|
* @package cake.tests
|
|
* @subpackage cake.tests.cases.libs.model.datasources.dbo
|
|
*/
|
|
class DboMysqlTest extends UnitTestCase {
|
|
/**
|
|
* The Dbo instance to be tested
|
|
*
|
|
* @var object
|
|
* @access public
|
|
*/
|
|
var $Db = null;
|
|
/**
|
|
* Skip if cannot connect to mysql
|
|
*
|
|
* @return void
|
|
* @access public
|
|
*/
|
|
function skip() {
|
|
$skip = true;
|
|
if(function_exists('mysql_connect')) {
|
|
$skip = false;
|
|
}
|
|
$this->skipif ($skip, 'Mysql not installed');
|
|
}
|
|
|
|
/**
|
|
* Sets up a Dbo class instance for testing
|
|
*
|
|
* @return void
|
|
* @access public
|
|
*/
|
|
function setUp() {
|
|
$this->Db =& new DboMysql(array());
|
|
$this->Db->fullDebug = 0;
|
|
}
|
|
/**
|
|
* Sets up a Dbo class instance for testing
|
|
*
|
|
* @return void
|
|
* @access public
|
|
*/
|
|
function tearDown() {
|
|
unset($this->Db);
|
|
}
|
|
/**
|
|
* Test Dbo value method
|
|
*
|
|
* @return void
|
|
* @access public
|
|
*/
|
|
function testValue() {
|
|
$expected = 1.2;
|
|
$result = $this->Db->value(1.2, 'float');
|
|
$this->assertIdentical($expected, $result);
|
|
|
|
$expected = "'1,2'";
|
|
$result = $this->Db->value('1,2', 'float');
|
|
$this->assertIdentical($expected, $result);
|
|
}
|
|
}
|
|
?>
|