more cleanup for API docs to be generated without errors

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@323 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2005-07-04 04:16:20 +00:00
parent 3500ca272c
commit 6ca443861d
26 changed files with 745 additions and 113 deletions

View file

@ -345,6 +345,7 @@ class Controller extends Object
* Sets data for this view. Will set title if the key "title" is in given $data array. * Sets data for this view. Will set title if the key "title" is in given $data array.
* *
* @param array $data Array of * @param array $data Array of
* @access private
*/ */
function _setArray($data) function _setArray($data)
{ {
@ -361,6 +362,7 @@ class Controller extends Object
* Set the title element of the page. * Set the title element of the page.
* *
* @param string $pageTitle Text for the title * @param string $pageTitle Text for the title
* @access private
*/ */
function _setTitle($pageTitle) function _setTitle($pageTitle)
{ {

View file

@ -21,7 +21,7 @@
* @copyright Copyright (c) 2005, CakePHP Authors/Developers * @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers * @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake * @package cake
* @subpackage cake.libs * @subpackage cake.libs.dbo
* @since CakePHP v 0.2.9 * @since CakePHP v 0.2.9
* @version $Revision$ * @version $Revision$
* @modifiedby $LastChangedBy$ * @modifiedby $LastChangedBy$
@ -38,7 +38,7 @@ require_once(VENDORS.'adodb/adodb.inc.php');
* AdoDB layer for DBO. * AdoDB layer for DBO.
* *
* @package cake * @package cake
* @subpackage cake.libs * @subpackage cake.libs.dbo
* @since CakePHP v 0.2.9 * @since CakePHP v 0.2.9
*/ */
class DBO_AdoDB extends DBO class DBO_AdoDB extends DBO
@ -48,6 +48,7 @@ class DBO_AdoDB extends DBO
* ADOConnection object with which we connect. * ADOConnection object with which we connect.
* *
* @var ADOConnection The connection object. * @var ADOConnection The connection object.
* @access private
*/ */
var $_adodb = null; var $_adodb = null;

View file

@ -21,7 +21,7 @@
* @copyright Copyright (c) 2005, CakePHP Authors/Developers * @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers * @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake * @package cake
* @subpackage cake.libs * @subpackage cake.libs.dbo
* @since CakePHP v 0.2.9 * @since CakePHP v 0.2.9
* @version $Revision$ * @version $Revision$
* @modifiedby $LastChangedBy$ * @modifiedby $LastChangedBy$
@ -29,53 +29,115 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License * @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/ */
/**
* AdoDB layer for DBO.
*
* @package cake
* @subpackage cake.libs.dbo
* @since CakePHP v 0.2.9
*/
class DBO_generic extends DBO class DBO_generic extends DBO
{ {
/**
* Enter description here...
*
* @param unknown_type $config
*/
function connect ($config) function connect ($config)
{ {
} }
/**
* Enter description here...
*
*/
function disconnect () function disconnect ()
{ {
} }
/**
* Enter description here...
*
* @param unknown_type $sql
*/
function execute ($sql) function execute ($sql)
{ {
} }
/**
* Enter description here...
*
*/
function fetchRow () function fetchRow ()
{ {
} }
/**
* Enter description here...
*
*/
function tablesList () function tablesList ()
{ {
} }
/**
* Enter description here...
*
* @param unknown_type $table_name
*/
function fields ($table_name) function fields ($table_name)
{ {
} }
/**
* Enter description here...
*
* @param unknown_type $data
*/
function prepareValue ($data) function prepareValue ($data)
{ {
} }
/**
* Enter description here...
*
*/
function lastError () function lastError ()
{ {
} }
/**
* Enter description here...
*
*/
function lastAffected () function lastAffected ()
{ {
} }
/**
* Enter description here...
*
*/
function lastNumRows () function lastNumRows ()
{ {
} }
/**
* Enter description here...
*
*/
function lastInsertId () function lastInsertId ()
{ {
} }
/**
* Enter description here...
*
* @param unknown_type $limit
* @param unknown_type $offset
*/
function selectLimit ($limit, $offset=null) function selectLimit ($limit, $offset=null)
{ {
} }

View file

@ -21,7 +21,7 @@
* @copyright Copyright (c) 2005, CakePHP Authors/Developers * @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers * @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake * @package cake
* @subpackage cake.libs * @subpackage cake.libs.dbo
* @since CakePHP v 0.2.9 * @since CakePHP v 0.2.9
* @version $Revision$ * @version $Revision$
* @modifiedby $LastChangedBy$ * @modifiedby $LastChangedBy$
@ -38,7 +38,7 @@ uses('dbo');
* MySQL layer for DBO. * MySQL layer for DBO.
* *
* @package cake * @package cake
* @subpackage cake.libs * @subpackage cake.libs.dbo
* @since CakePHP v 0.2.9 * @since CakePHP v 0.2.9
*/ */
class DBO_MySQL extends DBO class DBO_MySQL extends DBO

View file

@ -21,7 +21,7 @@
* @copyright Copyright (c) 2005, CakePHP Authors/Developers * @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers * @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake * @package cake
* @subpackage cake.libs * @subpackage cake.libs.dbo
* @since CakePHP v 0.2.9 * @since CakePHP v 0.2.9
* @version $Revision$ * @version $Revision$
* @modifiedby $LastChangedBy$ * @modifiedby $LastChangedBy$
@ -40,7 +40,7 @@ vendor('Pear/DB');
* Pear::DB layer for DBO. * Pear::DB layer for DBO.
* *
* @package cake * @package cake
* @subpackage cake.libs * @subpackage cake.libs.dbo
* @since CakePHP v 0.2.9 * @since CakePHP v 0.2.9
*/ */
class DBO_Pear extends DBO class DBO_Pear extends DBO
@ -50,6 +50,7 @@ class DBO_Pear extends DBO
* PEAR::DB object with which we connect. * PEAR::DB object with which we connect.
* *
* @var DB The connection object. * @var DB The connection object.
* @access private
*/ */
var $_pear = null; var $_pear = null;

View file

@ -21,7 +21,7 @@
* @copyright Copyright (c) 2005, CakePHP Authors/Developers * @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers * @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake * @package cake
* @subpackage cake.libs * @subpackage cake.libs.dbo
* @since CakePHP v 1.0.0.114 * @since CakePHP v 1.0.0.114
* @version $Revision$ * @version $Revision$
* @modifiedby $LastChangedBy$ * @modifiedby $LastChangedBy$
@ -38,7 +38,7 @@ uses('dbo');
* PostgreSQL layer for DBO. * PostgreSQL layer for DBO.
* *
* @package cake * @package cake
* @subpackage cake.libs * @subpackage cake.libs.dbo
* @since CakePHP v 1.0.0.114 * @since CakePHP v 1.0.0.114
*/ */
class DBO_Postgres extends DBO class DBO_Postgres extends DBO

View file

@ -21,7 +21,7 @@
* @copyright Copyright (c) 2005, CakePHP Authors/Developers * @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers * @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake * @package cake
* @subpackage cake.libs * @subpackage cake.libs.dbo
* @since CakePHP v 0.9.0 * @since CakePHP v 0.9.0
* @version $Revision$ * @version $Revision$
* @modifiedby $LastChangedBy$ * @modifiedby $LastChangedBy$
@ -38,7 +38,7 @@ uses('dbo');
* SQLite layer for DBO. * SQLite layer for DBO.
* *
* @package cake * @package cake
* @subpackage cake.libs * @subpackage cake.libs.dbo
* @since CakePHP v 0.9.0 * @since CakePHP v 0.9.0
*/ */
class DBO_SQLite extends DBO class DBO_SQLite extends DBO

View file

@ -22,6 +22,9 @@
* @author CakePHP Authors/Developers * @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers * @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers * @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.libs.dbo
* @since CakePHP v 0.2.9
* @version $Revision$ * @version $Revision$
* @modifiedby $LastChangedBy$ * @modifiedby $LastChangedBy$
* @lastmodified $Date$ * @lastmodified $Date$
@ -39,7 +42,7 @@ config('database');
* Enter description here... * Enter description here...
* *
* @package cake * @package cake
* @subpackage cake.libs * @subpackage cake.libs.dbo
* @since CakePHP v 1.0.0.0 * @since CakePHP v 1.0.0.0
* *
*/ */

View file

@ -30,12 +30,18 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License * @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/ */
/**
* Add Description
*/
define('DISPATCH_NO_CONTROLLER', 'missingController'); define('DISPATCH_NO_CONTROLLER', 'missingController');
define('DISPATCH_UNKNOWN_CONTROLLER', 'missingController'); define('DISPATCH_UNKNOWN_CONTROLLER', 'missingController');
define('DISPATCH_NO_ACTION', 'missingAction'); define('DISPATCH_NO_ACTION', 'missingAction');
define('DISPATCH_UNKNOWN_ACTION', 'missingAction'); define('DISPATCH_UNKNOWN_ACTION', 'missingAction');
define('DISPATCHER_UNKNOWN_VIEW', 'missingView'); define('DISPATCHER_UNKNOWN_VIEW', 'missingView');
/**
* Add Description
*/
uses('error_messages', 'object', 'router', 'controller'); uses('error_messages', 'object', 'router', 'controller');
/** /**

View file

@ -1,24 +1,90 @@
<?php // $Id$ <?php
//////////////////////////////////////////////////////////////////////////
// + $Id:$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + See: http://www.opensource.org/licenses/mit-license.php + //
//////////////////////////////////////////////////////////////////////////
/**
* Purpose: Dispatcher
* Dispatches the request, creating aproppriate models and controllers.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.libs
* @since CakePHP v 0.2.9
* @version $Revision:$
* @modifiedby $LastChangedBy:$
* @lastmodified $Date:$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
/**
* Dispatches the request, creating appropriate models and controllers.
*
* @package cake
* @subpackage cake.libs
* @since CakePHP v 0.2.9
*/
class File class File
{ {
/**
* Enter description here...
*
* @var unknown_type
*/
var $path = null; var $path = null;
/**
* Enter description here...
*
* @param unknown_type $path
* @return File
*/
function File ($path) function File ($path)
{ {
$this->path = $path; $this->path = $path;
} }
/**
* Enter description here...
*
* @return unknown
*/
function read () function read ()
{ {
return file_get_contents($this->path); return file_get_contents($this->path);
} }
/**
* Enter description here...
*
* @param unknown_type $data
* @return unknown
*/
function append ($data) function append ($data)
{ {
return $this->write($data, 'a'); return $this->write($data, 'a');
} }
/**
* Enter description here...
*
* @param unknown_type $data
* @param unknown_type $mode
* @return unknown
*/
function write ($data, $mode = 'w') function write ($data, $mode = 'w')
{ {
if (!($handle = fopen($this->path, $mode))) if (!($handle = fopen($this->path, $mode)))

View file

@ -170,6 +170,7 @@ class Folder extends Object {
* *
* @param string $pattern * @param string $pattern
* @return array Files matching pattern * @return array Files matching pattern
* @access private
*/ */
function _findRecursive ($pattern) { function _findRecursive ($pattern) {
list($dirs, $files) = $this->ls(); list($dirs, $files) = $this->ls();

View file

@ -1,5 +1,43 @@
<?php <?php
//////////////////////////////////////////////////////////////////////////
// + $Id:$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + See: http://www.opensource.org/licenses/mit-license.php + //
//////////////////////////////////////////////////////////////////////////
/**
* Purpose: Dispatcher
* Dispatches the request, creating aproppriate models and controllers.
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.libs.helpers
* @since CakePHP v 0.2.9
* @version $Revision:$
* @modifiedby $LastChangedBy:$
* @lastmodified $Date:$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
/**
* AjaxHelper helper library.
*
* @package cake
* @subpackage cake.libs.helpers
* @since CakePHP v 0.9.1
*
*/
class AjaxHelper class AjaxHelper
{ {
} }

View file

@ -531,7 +531,7 @@ class HtmlHelper
} }
/** /**
* Generates a nested <UL> (unordered list) tree from an array * Generates a nested <UL> </UL> (unordered list) tree from an array
* *
* @param array $data * @param array $data
* @param array $htmlOptions * @param array $htmlOptions

View file

@ -31,6 +31,9 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License * @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/ */
/**
* Enter description here...
*/
if (version_compare(phpversion(), '5.0') < 0) { if (version_compare(phpversion(), '5.0') < 0) {
eval(' eval('
function clone($object) { function clone($object) {
@ -40,18 +43,21 @@ if (version_compare(phpversion(), '5.0') < 0) {
} }
if (!function_exists('file_get_contents')) {
/** /**
* Replace file_get_contents() * Replace file_get_contents()
* *
* @category PHP
* @package PHP_Compat
* @link http://php.net/function.file_get_contents * @link http://php.net/function.file_get_contents
* @author Aidan Lister <aidan@php.net> * @author Aidan Lister <aidan@php.net>
* @internal resource_context is not supported * @internal resource_context is not supported
* @since PHP 5 * @since PHP 5
* @require PHP 4.0.0 (user_error) * require PHP 4.0.0 (user_error)
*
* @param unknown_type $filename
* @param unknown_type $incpath
* @return unknown
*/ */
if (!function_exists('file_get_contents')) {
function file_get_contents($filename, $incpath = false) function file_get_contents($filename, $incpath = false)
{ {
if (false === $fh = fopen($filename, 'rb', $incpath)) { if (false === $fh = fopen($filename, 'rb', $incpath)) {

View file

@ -636,6 +636,7 @@ class Model extends Object
* @param unknown_type $data * @param unknown_type $data
* @param unknown_type $root NULL or id for root node of operation * @param unknown_type $root NULL or id for root node of operation
* @return array * @return array
* @access private
*/ */
function _doThread ($data, $root) function _doThread ($data, $root)
{ {
@ -711,6 +712,7 @@ class Model extends Object
* *
* @param array $data * @param array $data
* @return array Array of invalid fields * @return array Array of invalid fields
* @access private
*/ */
function _invalidFields ($data=null) function _invalidFields ($data=null)
{ {

View file

@ -32,7 +32,9 @@
/** /**
* Enter description here... * Enter description here...
* * @package cake
* @subpackage cake.libs
* @since CakePHP v 0.2.9
* @static * @static
*/ */
class NeatString{ class NeatString{

View file

@ -421,6 +421,7 @@ class View extends Object
* *
* @param string $action Controller action to find template filename for * @param string $action Controller action to find template filename for
* @return string Template filename * @return string Template filename
* @access private
*/ */
function _getViewFileName($action) function _getViewFileName($action)
{ {
@ -440,6 +441,7 @@ class View extends Object
* Returns layout filename for this template as a string. * Returns layout filename for this template as a string.
* *
* @return string Filename for layout file (.thtml). * @return string Filename for layout file (.thtml).
* @access private
*/ */
function _getLayoutFileName() function _getLayoutFileName()
{ {
@ -454,6 +456,7 @@ class View extends Object
* @param array $___data_for_view Data to include in rendered view * @param array $___data_for_view Data to include in rendered view
* @param boolean $___play_safe If set to false, the include() of the $__viewFn is done without suppressing output of errors * @param boolean $___play_safe If set to false, the include() of the $__viewFn is done without suppressing output of errors
* @return string Rendered output * @return string Rendered output
* @access private
*/ */
function _render($___viewFn, $___data_for_view, $___play_safe = true) function _render($___viewFn, $___data_for_view, $___play_safe = true)
{ {

View file

@ -1,27 +1,33 @@
<?php <?php
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// + $Id$ // + $Id:$
// +------------------------------------------------------------------+ // // +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ // // +------------------------------------------------------------------+ //
// + Licensed + // // + Licensed under The MIT License + //
// + + // // + Redistributions of files must retain the above copyright notice. + //
// + + // // + See: http://www.opensource.org/licenses/mit-license.php + //
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/** /**
* Purpose: *
* *
* @filesource * @filesource
* @author CakePHP Authors/Developers * @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers * @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://developers.nextco.com/cake/wiki/Authors Authors/Developers * @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake * @package cake
* @subpackage cake.public * @subpackage cake.libs
* @since CakePHP v 0.2.9 * @since CakePHP v 0.2.9
* @version $Revision$ * @version $Revision$
* @modifiedby $LastChangedBy$ * @modifiedby $LastChangedBy$
* @lastmodified $Date$ * @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License * @license http://www.opensource.org/licenses/mit-license.php The MIT License
*
*/ */
/** /**

View file

@ -85,13 +85,25 @@ foreach ($testsFolder->findRecursive('.*\.php') as $test)
/** /**
* Better formatting of HTML reporter. * Better formatting of HTML reporter.
* @package cake
* @subpackage cake.scripts
*/ */
class CakeHtmlReporter extends HtmlReporter class CakeHtmlReporter extends HtmlReporter
{ {
/**
* Enter description here...
*
* @return unknown
*/
function _getCss() function _getCss()
{ {
return '.error { margin: 10px 0px; border: 1px solid #d7d4c7; padding: 4px; } .fail { color: red; font-weight: bold; } pre { background-color: lightgray; } .msg { margin-top: 5px; } body { font-family: Verdana; font-size: small; }'; return '.error { margin: 10px 0px; border: 1px solid #d7d4c7; padding: 4px; } .fail { color: red; font-weight: bold; } pre { background-color: lightgray; } .msg { margin-top: 5px; } body { font-family: Verdana; font-size: small; }';
} }
/**
* Enter description here...
*
* @param unknown_type $message
*/
function paintFail($message) function paintFail($message)
{ {
print '<div class="error">'; print '<div class="error">';
@ -102,6 +114,11 @@ class CakeHtmlReporter extends HtmlReporter
print '<div class="msg">' . $this->_htmlEntities($message) . "</div>\n"; print '<div class="msg">' . $this->_htmlEntities($message) . "</div>\n";
print '</div>'; print '</div>';
} }
/**
* Enter description here...
*
* @param unknown_type $message
*/
function paintException($message) function paintException($message)
{ {
print '<div class="error">'; print '<div class="error">';

View file

@ -1,68 +1,133 @@
<?php <?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + See: http://www.opensource.org/licenses/mit-license.php + //
//////////////////////////////////////////////////////////////////////////
/**
*
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.tests.libs
* @since CakePHP v 0.2.9
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*
*/
/**
*
*/
uses('dbo_factory'); uses('dbo_factory');
/**
* Enter description here...
*
* @package cake
* @subpackage cake.tests.libs
* @since CakePHP v .9
*
*/
class DboFactoryTest extends UnitTestCase class DboFactoryTest extends UnitTestCase
{ {
/**
* Enter description here...
*
* @var unknown_type
*/
var $dboFactory; var $dboFactory;
// constructor of the test suite
/**
* Enter description here...
*
* @return DboFactoryTest
*/
function DboFactoryTest() function DboFactoryTest()
{ {
$this->UnitTestCase('DBO Factory test'); $this->UnitTestCase('DBO Factory test');
} }
/* // called before the test functions will be executed // called before the test functions will be executed
// this function is defined in PHPUnit_TestCase and overwritten // this function is defined in PHPUnit_TestCase and overwritten
// here // here
function setUp()
{
$this->dboFactory = new DboFactory();
}
// called after the test functions are executed /**
// this function is defined in PHPUnit_TestCase and overwritten * Enter description here...
// here *
function tearDown() */
{ //function setUp()
unset($this->dboFactory); //{
} // $this->dboFactory = new DboFactory();
//}
function testMake() /**
{ * Enter description here...
if(class_exists('DATABASE_CONFIG')) *
{ */
//function tearDown()
//{
// unset($this->dboFactory);
//}
$output = $this->dboFactory->make('test'); /**
$this->assertTrue(is_object($output), 'We create dbo factory object'); * Enter description here...
*
*/
//function testMake()
//{
// if(class_exists('DATABASE_CONFIG'))
// {
$config = DATABASE_CONFIG::test(); // $output = $this->dboFactory->make('test');
if(preg_match('#^(adodb)_.*$#i', $config['driver'], $res)) // $this->assertTrue(is_object($output), 'We create dbo factory object');
{ //
$desiredDriverName = $res[1]; // $config = DATABASE_CONFIG::test();
} // if(preg_match('#^(adodb)_.*$#i', $config['driver'], $res))
else // {
{ // $desiredDriverName = $res[1];
$desiredDriverName = $config['driver']; // }
} // else
// {
// $desiredDriverName = $config['driver'];
// }
$desiredClassName = 'dbo_'.strtolower($desiredDriverName); // $desiredClassName = 'dbo_'.strtolower($desiredDriverName);
$outputClassName = is_object($output)? strtolower(get_class($output)): false; // $outputClassName = is_object($output)? strtolower(get_class($output)): false;
$this->assertEqual($outputClassName, $desiredClassName, "Class name should be $desiredClassName - is $outputClassName"); // $this->assertEqual($outputClassName, $desiredClassName, "Class name should be $desiredClassName - is $outputClassName");
$this->assertTrue($output->connected, 'We are connected'); // $this->assertTrue($output->connected, 'We are connected');
} // }
} //}
// this test expect an E_USER_ERROR to occur during it's run // this test expect an E_USER_ERROR to occur during it's run
// I've disabled it until I find a way to assert it happen // I've disabled it until I find a way to assert it happen
// //
/**
* Enter description here...
*
*/
// function testBadConfig() { // function testBadConfig() {
// $output = $this->dboFactory->make(null); // $output = $this->dboFactory->make(null);
// $this->assertTrue($output === false); // $this->assertTrue($output === false);
// }*/ //}
} }
?> ?>

View file

@ -1,34 +1,89 @@
<?php <?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + See: http://www.opensource.org/licenses/mit-license.php + //
//////////////////////////////////////////////////////////////////////////
/**
*
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.tests.libs
* @since CakePHP v 0.2.9
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*
*/
/**
*
*/
uses ('flay'); uses ('flay');
/**
* Enter description here...
*
* @package cake
* @subpackage cake.tests.libs
* @since CakePHP v .9
*
*/
class FlayTest extends UnitTestCase class FlayTest extends UnitTestCase
{ {
/**
* Enter description here...
*
* @var unknown_type
*/
var $flay; var $flay;
// constructor of the test suite /**
* Enter description here...
*
* @return FlayTest
*/
function FlayTest() function FlayTest()
{ {
$this->UnitTestCase('Flay test'); $this->UnitTestCase('Flay test');
} }
// called before the test functions will be executed /**
// this function is defined in PHPUnit_TestCase and overwritten * Enter description here...
// here *
*/
function setUp() function setUp()
{ {
$this->flay = new Flay (); $this->flay = new Flay ();
} }
// called after the test functions are executed /**
// this function is defined in PHPUnit_TestCase and overwritten * Enter description here...
// here *
*/
function tearDown() function tearDown()
{ {
unset($this->flay); unset($this->flay);
} }
/**
* Enter description here...
*
*/
function testToHtml() function testToHtml()
{ {
$tests_to_html = array( $tests_to_html = array(

View file

@ -1,21 +1,76 @@
<?php <?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + See: http://www.opensource.org/licenses/mit-license.php + //
//////////////////////////////////////////////////////////////////////////
/**
*
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.tests.libs
* @since CakePHP v 0.2.9
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*
*/
/**
*
*/
uses('folder'); uses('folder');
/**
* Enter description here...
*
* @package cake
* @subpackage cake.tests.libs
* @since CakePHP v .9
*
*/
class FolderTest extends UnitTestCase class FolderTest extends UnitTestCase
{ {
/**
* Enter description here...
*
* @var unknown_type
*/
var $folder; var $folder;
/**
* Enter description here...
*
* @var unknown_type
*/
var $testDir; var $testDir;
// constructor of the test suite /**
* Enter description here...
*
* @return FolderTest
*/
function FolderTest() function FolderTest()
{ {
$this->UnitTestCase('Folder test'); $this->UnitTestCase('Folder test');
} }
// called before the test functions will be executed /**
// this function is defined in PHPUnit_TestCase and overwritten * Enter description here...
// here *
*/
function setUp() function setUp()
{ {
$this->testDir = ROOT.'tmp'.DS.'tests'; $this->testDir = ROOT.'tmp'.DS.'tests';
@ -40,9 +95,10 @@ class FolderTest extends UnitTestCase
$this->folder = new Folder($this->testDir); $this->folder = new Folder($this->testDir);
} }
// called after the test functions are executed /**
// this function is defined in PHPUnit_TestCase and overwritten * Enter description here...
// here *
*/
function tearDown() function tearDown()
{ {
unlink($this->testDir.DS.'.htaccess'); unlink($this->testDir.DS.'.htaccess');
@ -56,6 +112,10 @@ class FolderTest extends UnitTestCase
} }
/**
* Enter description here...
*
*/
function testLs() function testLs()
{ {
$result = $this->folder->ls(); $result = $this->folder->ls();
@ -67,6 +127,10 @@ class FolderTest extends UnitTestCase
$this->assertEqual($result, $expected, "List directories and files from test dir"); $this->assertEqual($result, $expected, "List directories and files from test dir");
} }
/**
* Enter description here...
*
*/
function testPwd() function testPwd()
{ {
$result = $this->folder->pwd(); $result = $this->folder->pwd();
@ -74,6 +138,10 @@ class FolderTest extends UnitTestCase
$this->assertEqual($result, $this->testDir, 'Print current path (test dir)'); $this->assertEqual($result, $this->testDir, 'Print current path (test dir)');
} }
/**
* Enter description here...
*
*/
function testCd() function testCd()
{ {
$this->folder->cd($this->testDir); $this->folder->cd($this->testDir);
@ -87,6 +155,10 @@ class FolderTest extends UnitTestCase
$this->assertEqual($result, Folder::addPathElement($this->testDir, 'dir1'), 'Change directory to dir1'); $this->assertEqual($result, Folder::addPathElement($this->testDir, 'dir1'), 'Change directory to dir1');
} }
/**
* Enter description here...
*
*/
function testFindRecursive() function testFindRecursive()
{ {
$result = $this->folder->findRecursive('.*\.php'); $result = $this->folder->findRecursive('.*\.php');
@ -95,6 +167,10 @@ class FolderTest extends UnitTestCase
$this->assertEqual($result, $expected, 'Find .php files'); $this->assertEqual($result, $expected, 'Find .php files');
} }
/**
* Enter description here...
*
*/
function testIsWindowsPath() function testIsWindowsPath()
{ {
$result = Folder::isWindowsPath('C:\foo'); $result = Folder::isWindowsPath('C:\foo');
@ -106,6 +182,10 @@ class FolderTest extends UnitTestCase
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
} }
/**
* Enter description here...
*
*/
function testIsAbsolute() function testIsAbsolute()
{ {
$result = Folder::isAbsolute('foo/bar'); $result = Folder::isAbsolute('foo/bar');
@ -117,6 +197,10 @@ class FolderTest extends UnitTestCase
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
} }
/**
* Enter description here...
*
*/
function testAddPathElement() function testAddPathElement()
{ {
$result = Folder::addPathElement('c:\foo', 'bar'); $result = Folder::addPathElement('c:\foo', 'bar');
@ -132,6 +216,10 @@ class FolderTest extends UnitTestCase
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
} }
/**
* Enter description here...
*
*/
function testIsSlashTerm() function testIsSlashTerm()
{ {
$result = Folder::isSlashTerm('/foo/bar/'); $result = Folder::isSlashTerm('/foo/bar/');
@ -141,6 +229,10 @@ class FolderTest extends UnitTestCase
$this->assertEqual($result, false); $this->assertEqual($result, false);
} }
/**
* Enter description here...
*
*/
function testCorrectSlashFor() function testCorrectSlashFor()
{ {
$result = Folder::correctSlashFor('/foo/bar/'); $result = Folder::correctSlashFor('/foo/bar/');
@ -150,6 +242,10 @@ class FolderTest extends UnitTestCase
$this->assertEqual($result, '\\'); $this->assertEqual($result, '\\');
} }
/**
* Enter description here...
*
*/
function testSlashTerm() function testSlashTerm()
{ {
$result = Folder::slashTerm('/foo/bar/'); $result = Folder::slashTerm('/foo/bar/');

View file

@ -1,6 +1,6 @@
<?php <?php
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// + $Id:$ // + $Id$
// +------------------------------------------------------------------+ // // +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + // // + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + // // + Copyright: (c) 2005, CakePHP Authors/Developers + //
@ -21,11 +21,11 @@
* @copyright Copyright (c) 2005, CakePHP Authors/Developers * @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers * @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake * @package cake
* @subpackage cake.tests.libs * @subpackage cake.tests.libs.helpers
* @since CakePHP v 0.2.9 * @since CakePHP v 0.2.9
* @version $Revision:$ * @version $Revision$
* @modifiedby $LastChangedBy$ * @modifiedby $LastChangedBy$
* @lastmodified $Date:$ * @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License * @license http://www.opensource.org/licenses/mit-license.php The MIT License
* *
*/ */
@ -38,7 +38,7 @@ uses('helpers/html');
* Enter description here... * Enter description here...
* *
* @package cake * @package cake
* @subpackage cake.tests.libs * @subpackage cake.tests.libs.helpers
* @since CakePHP v .9 * @since CakePHP v .9
* *
*/ */

View file

@ -1,26 +1,88 @@
<?php <?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + See: http://www.opensource.org/licenses/mit-license.php + //
//////////////////////////////////////////////////////////////////////////
/**
*
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.tests.libs
* @since CakePHP v 0.2.9
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*
*/
/**
*
*/
uses('inflector'); uses('inflector');
/**
* Enter description here...
*
* @package cake
* @subpackage cake.tests.libs
* @since CakePHP v .9
*
*/
class InflectorTest extends UnitTestCase class InflectorTest extends UnitTestCase
{ {
/**
* Enter description here...
*
* @var unknown_type
*/
var $inflector; var $inflector;
/**
* Enter description here...
*
* @return InflectorTest
*/
function InflectorTest() function InflectorTest()
{ {
$this->UnitTestCase('Inflector test'); $this->UnitTestCase('Inflector test');
} }
/**
* Enter description here...
*
*/
function setUp() function setUp()
{ {
$this->inflector = new Inflector(); $this->inflector = new Inflector();
} }
/**
* Enter description here...
*
*/
function tearDown() function tearDown()
{ {
unset($this->inflector); unset($this->inflector);
} }
/**
* Enter description here...
*
*/
function testPluralizeSingularize() function testPluralizeSingularize()
{ {
$singulars = array( $singulars = array(
@ -39,31 +101,55 @@ class InflectorTest extends UnitTestCase
} }
} }
/**
* Enter description here...
*
*/
function testCamelize() function testCamelize()
{ {
$this->assertEqual($this->inflector->camelize('foo_bar_baz'), 'FooBarBaz'); $this->assertEqual($this->inflector->camelize('foo_bar_baz'), 'FooBarBaz');
} }
/**
* Enter description here...
*
*/
function testUnderscore() function testUnderscore()
{ {
$this->assertEqual($this->inflector->underscore('FooBarBaz'), 'foo_bar_baz'); $this->assertEqual($this->inflector->underscore('FooBarBaz'), 'foo_bar_baz');
} }
/**
* Enter description here...
*
*/
function testHumanize() function testHumanize()
{ {
$this->assertEqual($this->inflector->humanize('foo_bar_baz'), 'Foo Bar Baz'); $this->assertEqual($this->inflector->humanize('foo_bar_baz'), 'Foo Bar Baz');
} }
/**
* Enter description here...
*
*/
function testTableize() function testTableize()
{ {
$this->assertEqual($this->inflector->tableize('Bar'), 'bars'); $this->assertEqual($this->inflector->tableize('Bar'), 'bars');
} }
/**
* Enter description here...
*
*/
function testClassify() function testClassify()
{ {
$this->assertEqual($this->inflector->classify('bars'), 'Bar'); $this->assertEqual($this->inflector->classify('bars'), 'Bar');
} }
/**
* Enter description here...
*
*/
function testForeignKey() function testForeignKey()
{ {
$this->assertEqual($this->inflector->foreignKey('Bar'), 'bar_id'); $this->assertEqual($this->inflector->foreignKey('Bar'), 'bar_id');

View file

@ -1,34 +1,89 @@
<?php <?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + See: http://www.opensource.org/licenses/mit-license.php + //
//////////////////////////////////////////////////////////////////////////
/**
*
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.tests.libs
* @since CakePHP v 0.2.9
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*
*/
/**
*
*/
uses('neat_array'); uses('neat_array');
/**
* Enter description here...
*
* @package cake
* @subpackage cake.tests.libs
* @since CakePHP v .9
*
*/
class NeatArrayTest extends UnitTestCase class NeatArrayTest extends UnitTestCase
{ {
/**
* Enter description here...
*
* @var unknown_type
*/
var $neatArray; var $neatArray;
// constructor of the test suite /**
* Enter description here...
*
* @return NeatArrayTest
*/
function NeatArrayTest() function NeatArrayTest()
{ {
$this->UnitTestCase('NeatArray test'); $this->UnitTestCase('NeatArray test');
} }
// called before the test functions will be executed /**
// this function is defined in PHPUnit_TestCase and overwritten * Enter description here...
// here *
*/
function setUp() function setUp()
{ {
$this->neatArray = new NeatArray(); $this->neatArray = new NeatArray();
} }
// called after the test functions are executed /**
// this function is defined in PHPUnit_TestCase and overwritten * Enter description here...
// here *
*/
function tearDown() function tearDown()
{ {
unset($this->neatArray); unset($this->neatArray);
} }
/**
* Enter description here...
*
*/
function testInArray() function testInArray()
{ {
$a = array('foo'=>' bar ', 'i-am'=>'a'); $a = array('foo'=>' bar ', 'i-am'=>'a');

View file

@ -1,34 +1,89 @@
<?php <?php
//////////////////////////////////////////////////////////////////////////
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + Copyright: (c) 2005, CakePHP Authors/Developers + //
// + Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com> + //
// + Larry E. Masters aka PhpNut <nut@phpnut.com> + //
// + Kamil Dzielinski aka Brego <brego.dk@gmail.com> + //
// +------------------------------------------------------------------+ //
// + Licensed under The MIT License + //
// + Redistributions of files must retain the above copyright notice. + //
// + See: http://www.opensource.org/licenses/mit-license.php + //
//////////////////////////////////////////////////////////////////////////
/**
*
*
* @filesource
* @author CakePHP Authors/Developers
* @copyright Copyright (c) 2005, CakePHP Authors/Developers
* @link https://trac.cakephp.org/wiki/Authors Authors/Developers
* @package cake
* @subpackage cake.tests.libs
* @since CakePHP v 0.2.9
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*
*/
/**
*
*/
uses ('router'); uses ('router');
/**
* Enter description here...
*
* @package cake
* @subpackage cake.tests.libs
* @since CakePHP v .9
*
*/
class RouterTest extends UnitTestCase class RouterTest extends UnitTestCase
{ {
/**
* Enter description here...
*
* @var unknown_type
*/
var $router; var $router;
// constructor of the test suite /**
* Enter description here...
*
* @return RouterTest
*/
function RouterTest() function RouterTest()
{ {
$this->UnitTestCase('Router test'); $this->UnitTestCase('Router test');
} }
// called before the test functions will be executed /**
// this function is defined in PHPUnit_TestCase and overwritten * Enter description here...
// here *
*/
function setUp() function setUp()
{ {
$this->router = new Router(); $this->router = new Router();
} }
// called after the test functions are executed /**
// this function is defined in PHPUnit_TestCase and overwritten * Enter description here...
// here *
*/
function tearDown() function tearDown()
{ {
unset($this->router); unset($this->router);
} }
/**
* Enter description here...
*
*/
function _testConnect() function _testConnect()
{ {
$tests = array( $tests = array(
@ -43,6 +98,10 @@ class RouterTest extends UnitTestCase
} }
/**
* Enter description here...
*
*/
function testParse () function testParse ()
{ {