From 6ca443861dcb195d53bd50d1793a9aa01e9cb419 Mon Sep 17 00:00:00 2001 From: phpnut Date: Mon, 4 Jul 2005 04:16:20 +0000 Subject: [PATCH] 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 --- libs/controller.php | 2 + libs/dbo/dbo_adodb.php | 5 +- libs/dbo/dbo_generic.php | 64 ++++++++++++++++- libs/dbo/dbo_mysql.php | 4 +- libs/dbo/dbo_pear.php | 5 +- libs/dbo/dbo_postgres.php | 4 +- libs/dbo/dbo_sqlite.php | 4 +- libs/dbo_factory.php | 23 +++--- libs/dispatcher.php | 6 ++ libs/file.php | 68 +++++++++++++++++- libs/folder.php | 1 + libs/helpers/ajax.php | 38 ++++++++++ libs/helpers/html.php | 2 +- libs/legacy.php | 14 ++-- libs/model.php | 2 + libs/neat_string.php | 4 +- libs/view.php | 3 + public/css.php | 20 ++++-- scripts/test.php | 17 +++++ tests/libs/dbo_factory.php | 137 ++++++++++++++++++++++++++---------- tests/libs/flay.php | 71 ++++++++++++++++--- tests/libs/folder.php | 112 ++++++++++++++++++++++++++--- tests/libs/helpers/html.php | 18 ++--- tests/libs/inflector.php | 88 ++++++++++++++++++++++- tests/libs/neat_array.php | 71 ++++++++++++++++--- tests/libs/router.php | 75 +++++++++++++++++--- 26 files changed, 745 insertions(+), 113 deletions(-) diff --git a/libs/controller.php b/libs/controller.php index b32e6cb9a..b2a4b47d0 100644 --- a/libs/controller.php +++ b/libs/controller.php @@ -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. * * @param array $data Array of + * @access private */ function _setArray($data) { @@ -361,6 +362,7 @@ class Controller extends Object * Set the title element of the page. * * @param string $pageTitle Text for the title + * @access private */ function _setTitle($pageTitle) { diff --git a/libs/dbo/dbo_adodb.php b/libs/dbo/dbo_adodb.php index 4bec4857b..32c36c678 100644 --- a/libs/dbo/dbo_adodb.php +++ b/libs/dbo/dbo_adodb.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2005, CakePHP Authors/Developers * @link https://trac.cakephp.org/wiki/Authors Authors/Developers * @package cake - * @subpackage cake.libs + * @subpackage cake.libs.dbo * @since CakePHP v 0.2.9 * @version $Revision$ * @modifiedby $LastChangedBy$ @@ -38,7 +38,7 @@ require_once(VENDORS.'adodb/adodb.inc.php'); * AdoDB layer for DBO. * * @package cake - * @subpackage cake.libs + * @subpackage cake.libs.dbo * @since CakePHP v 0.2.9 */ class DBO_AdoDB extends DBO @@ -48,6 +48,7 @@ class DBO_AdoDB extends DBO * ADOConnection object with which we connect. * * @var ADOConnection The connection object. + * @access private */ var $_adodb = null; diff --git a/libs/dbo/dbo_generic.php b/libs/dbo/dbo_generic.php index 5aedbf863..577311395 100644 --- a/libs/dbo/dbo_generic.php +++ b/libs/dbo/dbo_generic.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2005, CakePHP Authors/Developers * @link https://trac.cakephp.org/wiki/Authors Authors/Developers * @package cake - * @subpackage cake.libs + * @subpackage cake.libs.dbo * @since CakePHP v 0.2.9 * @version $Revision$ * @modifiedby $LastChangedBy$ @@ -29,53 +29,115 @@ * @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 { + /** + * Enter description here... + * + * @param unknown_type $config + */ function connect ($config) { } + /** + * Enter description here... + * + */ function disconnect () { } + /** + * Enter description here... + * + * @param unknown_type $sql + */ function execute ($sql) { } + /** + * Enter description here... + * + */ function fetchRow () { } + /** + * Enter description here... + * + */ function tablesList () { } + /** + * Enter description here... + * + * @param unknown_type $table_name + */ function fields ($table_name) { } + /** + * Enter description here... + * + * @param unknown_type $data + */ function prepareValue ($data) { } + /** + * Enter description here... + * + */ function lastError () { } + /** + * Enter description here... + * + */ function lastAffected () { } + /** + * Enter description here... + * + */ function lastNumRows () { } + /** + * Enter description here... + * + */ function lastInsertId () { } + /** + * Enter description here... + * + * @param unknown_type $limit + * @param unknown_type $offset + */ function selectLimit ($limit, $offset=null) { } diff --git a/libs/dbo/dbo_mysql.php b/libs/dbo/dbo_mysql.php index d585512db..429ec3008 100644 --- a/libs/dbo/dbo_mysql.php +++ b/libs/dbo/dbo_mysql.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2005, CakePHP Authors/Developers * @link https://trac.cakephp.org/wiki/Authors Authors/Developers * @package cake - * @subpackage cake.libs + * @subpackage cake.libs.dbo * @since CakePHP v 0.2.9 * @version $Revision$ * @modifiedby $LastChangedBy$ @@ -38,7 +38,7 @@ uses('dbo'); * MySQL layer for DBO. * * @package cake - * @subpackage cake.libs + * @subpackage cake.libs.dbo * @since CakePHP v 0.2.9 */ class DBO_MySQL extends DBO diff --git a/libs/dbo/dbo_pear.php b/libs/dbo/dbo_pear.php index 9f7458193..ed7241d57 100644 --- a/libs/dbo/dbo_pear.php +++ b/libs/dbo/dbo_pear.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2005, CakePHP Authors/Developers * @link https://trac.cakephp.org/wiki/Authors Authors/Developers * @package cake - * @subpackage cake.libs + * @subpackage cake.libs.dbo * @since CakePHP v 0.2.9 * @version $Revision$ * @modifiedby $LastChangedBy$ @@ -40,7 +40,7 @@ vendor('Pear/DB'); * Pear::DB layer for DBO. * * @package cake - * @subpackage cake.libs + * @subpackage cake.libs.dbo * @since CakePHP v 0.2.9 */ class DBO_Pear extends DBO @@ -50,6 +50,7 @@ class DBO_Pear extends DBO * PEAR::DB object with which we connect. * * @var DB The connection object. + * @access private */ var $_pear = null; diff --git a/libs/dbo/dbo_postgres.php b/libs/dbo/dbo_postgres.php index cc1fa4f3c..ef31e66be 100644 --- a/libs/dbo/dbo_postgres.php +++ b/libs/dbo/dbo_postgres.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2005, CakePHP Authors/Developers * @link https://trac.cakephp.org/wiki/Authors Authors/Developers * @package cake - * @subpackage cake.libs + * @subpackage cake.libs.dbo * @since CakePHP v 1.0.0.114 * @version $Revision$ * @modifiedby $LastChangedBy$ @@ -38,7 +38,7 @@ uses('dbo'); * PostgreSQL layer for DBO. * * @package cake - * @subpackage cake.libs + * @subpackage cake.libs.dbo * @since CakePHP v 1.0.0.114 */ class DBO_Postgres extends DBO diff --git a/libs/dbo/dbo_sqlite.php b/libs/dbo/dbo_sqlite.php index 82e2ddfc4..debaeed0e 100644 --- a/libs/dbo/dbo_sqlite.php +++ b/libs/dbo/dbo_sqlite.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2005, CakePHP Authors/Developers * @link https://trac.cakephp.org/wiki/Authors Authors/Developers * @package cake - * @subpackage cake.libs + * @subpackage cake.libs.dbo * @since CakePHP v 0.9.0 * @version $Revision$ * @modifiedby $LastChangedBy$ @@ -38,7 +38,7 @@ uses('dbo'); * SQLite layer for DBO. * * @package cake - * @subpackage cake.libs + * @subpackage cake.libs.dbo * @since CakePHP v 0.9.0 */ class DBO_SQLite extends DBO diff --git a/libs/dbo_factory.php b/libs/dbo_factory.php index 9293f15b2..67e28d0db 100644 --- a/libs/dbo_factory.php +++ b/libs/dbo_factory.php @@ -18,15 +18,18 @@ * Description: * Creates DBO-descendant objects from a given db connection configuration * - * @filesource - * @author CakePHP Authors/Developers - * @copyright Copyright (c) 2005, CakePHP Authors/Developers - * @link https://trac.cakephp.org/wiki/Authors Authors/Developers - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License - */ + * @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.dbo + * @since CakePHP v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ /** * Enter description here... @@ -39,7 +42,7 @@ config('database'); * Enter description here... * * @package cake - * @subpackage cake.libs + * @subpackage cake.libs.dbo * @since CakePHP v 1.0.0.0 * */ diff --git a/libs/dispatcher.php b/libs/dispatcher.php index c473ebe2a..8a9bb85d7 100644 --- a/libs/dispatcher.php +++ b/libs/dispatcher.php @@ -30,12 +30,18 @@ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ +/** + * Add Description + */ define('DISPATCH_NO_CONTROLLER', 'missingController'); define('DISPATCH_UNKNOWN_CONTROLLER', 'missingController'); define('DISPATCH_NO_ACTION', 'missingAction'); define('DISPATCH_UNKNOWN_ACTION', 'missingAction'); define('DISPATCHER_UNKNOWN_VIEW', 'missingView'); +/** + * Add Description + */ uses('error_messages', 'object', 'router', 'controller'); /** diff --git a/libs/file.php b/libs/file.php index dd6dd37b4..3add38624 100644 --- a/libs/file.php +++ b/libs/file.php @@ -1,24 +1,90 @@ - + // +// + Copyright: (c) 2005, CakePHP Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + 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 { +/** + * Enter description here... + * + * @var unknown_type + */ var $path = null; +/** + * Enter description here... + * + * @param unknown_type $path + * @return File + */ function File ($path) { $this->path = $path; } +/** + * Enter description here... + * + * @return unknown + */ function read () { return file_get_contents($this->path); } +/** + * Enter description here... + * + * @param unknown_type $data + * @return unknown + */ function append ($data) { return $this->write($data, 'a'); } +/** + * Enter description here... + * + * @param unknown_type $data + * @param unknown_type $mode + * @return unknown + */ function write ($data, $mode = 'w') { if (!($handle = fopen($this->path, $mode))) diff --git a/libs/folder.php b/libs/folder.php index 619c921ca..fbb4b98d4 100644 --- a/libs/folder.php +++ b/libs/folder.php @@ -170,6 +170,7 @@ class Folder extends Object { * * @param string $pattern * @return array Files matching pattern + * @access private */ function _findRecursive ($pattern) { list($dirs, $files) = $this->ls(); diff --git a/libs/helpers/ajax.php b/libs/helpers/ajax.php index 2d3b07ce4..759fbc069 100644 --- a/libs/helpers/ajax.php +++ b/libs/helpers/ajax.php @@ -1,5 +1,43 @@ + // +// + Copyright: (c) 2005, CakePHP Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + 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 { } diff --git a/libs/helpers/html.php b/libs/helpers/html.php index 54514fab1..0e7c5850a 100644 --- a/libs/helpers/html.php +++ b/libs/helpers/html.php @@ -531,7 +531,7 @@ class HtmlHelper } /** - * Generates a nested
    (unordered list) tree from an array + * Generates a nested
    (unordered list) tree from an array * * @param array $data * @param array $htmlOptions diff --git a/libs/legacy.php b/libs/legacy.php index edf78dd21..a1d2fe598 100644 --- a/libs/legacy.php +++ b/libs/legacy.php @@ -31,6 +31,9 @@ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ +/** + * Enter description here... + */ if (version_compare(phpversion(), '5.0') < 0) { eval(' function clone($object) { @@ -40,18 +43,21 @@ if (version_compare(phpversion(), '5.0') < 0) { } + +if (!function_exists('file_get_contents')) { /** * Replace file_get_contents() * - * @category PHP - * @package PHP_Compat * @link http://php.net/function.file_get_contents * @author Aidan Lister * @internal resource_context is not supported * @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) { if (false === $fh = fopen($filename, 'rb', $incpath)) { diff --git a/libs/model.php b/libs/model.php index ab00280bf..98ed15850 100644 --- a/libs/model.php +++ b/libs/model.php @@ -636,6 +636,7 @@ class Model extends Object * @param unknown_type $data * @param unknown_type $root NULL or id for root node of operation * @return array + * @access private */ function _doThread ($data, $root) { @@ -711,6 +712,7 @@ class Model extends Object * * @param array $data * @return array Array of invalid fields + * @access private */ function _invalidFields ($data=null) { diff --git a/libs/neat_string.php b/libs/neat_string.php index e32d1877a..0c692ee41 100644 --- a/libs/neat_string.php +++ b/libs/neat_string.php @@ -32,7 +32,9 @@ /** * Enter description here... - * + * @package cake + * @subpackage cake.libs + * @since CakePHP v 0.2.9 * @static */ class NeatString{ diff --git a/libs/view.php b/libs/view.php index 0b21c6db9..4ff9f6226 100644 --- a/libs/view.php +++ b/libs/view.php @@ -421,6 +421,7 @@ class View extends Object * * @param string $action Controller action to find template filename for * @return string Template filename + * @access private */ function _getViewFileName($action) { @@ -440,6 +441,7 @@ class View extends Object * Returns layout filename for this template as a string. * * @return string Filename for layout file (.thtml). + * @access private */ function _getLayoutFileName() { @@ -454,6 +456,7 @@ class View extends Object * @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 * @return string Rendered output + * @access private */ function _render($___viewFn, $___data_for_view, $___play_safe = true) { diff --git a/public/css.php b/public/css.php index 7a1a1fac8..ee7a6b172 100644 --- a/public/css.php +++ b/public/css.php @@ -1,27 +1,33 @@ + // +// + Copyright: (c) 2005, CakePHP Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // // +------------------------------------------------------------------+ // -// + 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 * @author 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 - * @subpackage cake.public + * @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 + * */ /** diff --git a/scripts/test.php b/scripts/test.php index ac8f00a56..9de4e9407 100644 --- a/scripts/test.php +++ b/scripts/test.php @@ -85,13 +85,25 @@ foreach ($testsFolder->findRecursive('.*\.php') as $test) /** * Better formatting of HTML reporter. + * @package cake + * @subpackage cake.scripts */ class CakeHtmlReporter extends HtmlReporter { +/** + * Enter description here... + * + * @return unknown + */ 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; }'; } +/** + * Enter description here... + * + * @param unknown_type $message + */ function paintFail($message) { print '
    '; @@ -102,6 +114,11 @@ class CakeHtmlReporter extends HtmlReporter print '
    ' . $this->_htmlEntities($message) . "
    \n"; print '
    '; } +/** + * Enter description here... + * + * @param unknown_type $message + */ function paintException($message) { print '
    '; diff --git a/tests/libs/dbo_factory.php b/tests/libs/dbo_factory.php index 279493280..0ee4e7aec 100644 --- a/tests/libs/dbo_factory.php +++ b/tests/libs/dbo_factory.php @@ -1,68 +1,133 @@ + // +// + Copyright: (c) 2005, CakePHP Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + 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'); - +/** + * Enter description here... + * + * @package cake + * @subpackage cake.tests.libs + * @since CakePHP v .9 + * + */ class DboFactoryTest extends UnitTestCase { +/** + * Enter description here... + * + * @var unknown_type + */ var $dboFactory; - // constructor of the test suite + +/** + * Enter description here... + * + * @return DboFactoryTest + */ function DboFactoryTest() { $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 // here - function setUp() - { - $this->dboFactory = new DboFactory(); - } - // called after the test functions are executed - // this function is defined in PHPUnit_TestCase and overwritten - // here - function tearDown() - { - unset($this->dboFactory); - } +/** + * Enter description here... + * + */ + //function setUp() + //{ + // $this->dboFactory = new DboFactory(); + //} - function testMake() - { - if(class_exists('DATABASE_CONFIG')) - { +/** + * Enter description here... + * + */ + //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(); - if(preg_match('#^(adodb)_.*$#i', $config['driver'], $res)) - { - $desiredDriverName = $res[1]; - } - else - { - $desiredDriverName = $config['driver']; - } + // $output = $this->dboFactory->make('test'); + // $this->assertTrue(is_object($output), 'We create dbo factory object'); + // + // $config = DATABASE_CONFIG::test(); + // if(preg_match('#^(adodb)_.*$#i', $config['driver'], $res)) + // { + // $desiredDriverName = $res[1]; + // } + // else + // { + // $desiredDriverName = $config['driver']; + // } - $desiredClassName = 'dbo_'.strtolower($desiredDriverName); - $outputClassName = is_object($output)? strtolower(get_class($output)): false; + // $desiredClassName = 'dbo_'.strtolower($desiredDriverName); + // $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 // I've disabled it until I find a way to assert it happen // + +/** + * Enter description here... + * + */ // function testBadConfig() { // $output = $this->dboFactory->make(null); // $this->assertTrue($output === false); - // }*/ + //} } ?> \ No newline at end of file diff --git a/tests/libs/flay.php b/tests/libs/flay.php index 7856de75f..df42439c1 100644 --- a/tests/libs/flay.php +++ b/tests/libs/flay.php @@ -1,34 +1,89 @@ + // +// + Copyright: (c) 2005, CakePHP Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + 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'); - +/** + * Enter description here... + * + * @package cake + * @subpackage cake.tests.libs + * @since CakePHP v .9 + * + */ class FlayTest extends UnitTestCase { +/** + * Enter description here... + * + * @var unknown_type + */ var $flay; - // constructor of the test suite +/** + * Enter description here... + * + * @return FlayTest + */ function FlayTest() { $this->UnitTestCase('Flay test'); } - // called before the test functions will be executed - // this function is defined in PHPUnit_TestCase and overwritten - // here +/** + * Enter description here... + * + */ function setUp() { $this->flay = new Flay (); } - // called after the test functions are executed - // this function is defined in PHPUnit_TestCase and overwritten - // here +/** + * Enter description here... + * + */ function tearDown() { unset($this->flay); } +/** + * Enter description here... + * + */ function testToHtml() { $tests_to_html = array( diff --git a/tests/libs/folder.php b/tests/libs/folder.php index 08692d565..0e71e7be6 100644 --- a/tests/libs/folder.php +++ b/tests/libs/folder.php @@ -1,21 +1,76 @@ + // +// + Copyright: (c) 2005, CakePHP Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + 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'); - +/** + * Enter description here... + * + * @package cake + * @subpackage cake.tests.libs + * @since CakePHP v .9 + * + */ class FolderTest extends UnitTestCase { +/** + * Enter description here... + * + * @var unknown_type + */ var $folder; +/** + * Enter description here... + * + * @var unknown_type + */ var $testDir; - // constructor of the test suite +/** + * Enter description here... + * + * @return FolderTest + */ function FolderTest() { $this->UnitTestCase('Folder test'); } - // called before the test functions will be executed - // this function is defined in PHPUnit_TestCase and overwritten - // here +/** + * Enter description here... + * + */ function setUp() { $this->testDir = ROOT.'tmp'.DS.'tests'; @@ -40,9 +95,10 @@ class FolderTest extends UnitTestCase $this->folder = new Folder($this->testDir); } - // called after the test functions are executed - // this function is defined in PHPUnit_TestCase and overwritten - // here +/** + * Enter description here... + * + */ function tearDown() { unlink($this->testDir.DS.'.htaccess'); @@ -56,6 +112,10 @@ class FolderTest extends UnitTestCase } +/** + * Enter description here... + * + */ function testLs() { $result = $this->folder->ls(); @@ -67,6 +127,10 @@ class FolderTest extends UnitTestCase $this->assertEqual($result, $expected, "List directories and files from test dir"); } +/** + * Enter description here... + * + */ function testPwd() { $result = $this->folder->pwd(); @@ -74,6 +138,10 @@ class FolderTest extends UnitTestCase $this->assertEqual($result, $this->testDir, 'Print current path (test dir)'); } +/** + * Enter description here... + * + */ function testCd() { $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'); } +/** + * Enter description here... + * + */ function testFindRecursive() { $result = $this->folder->findRecursive('.*\.php'); @@ -95,6 +167,10 @@ class FolderTest extends UnitTestCase $this->assertEqual($result, $expected, 'Find .php files'); } +/** + * Enter description here... + * + */ function testIsWindowsPath() { $result = Folder::isWindowsPath('C:\foo'); @@ -106,6 +182,10 @@ class FolderTest extends UnitTestCase $this->assertEqual($result, $expected); } +/** + * Enter description here... + * + */ function testIsAbsolute() { $result = Folder::isAbsolute('foo/bar'); @@ -117,6 +197,10 @@ class FolderTest extends UnitTestCase $this->assertEqual($result, $expected); } +/** + * Enter description here... + * + */ function testAddPathElement() { $result = Folder::addPathElement('c:\foo', 'bar'); @@ -132,6 +216,10 @@ class FolderTest extends UnitTestCase $this->assertEqual($result, $expected); } +/** + * Enter description here... + * + */ function testIsSlashTerm() { $result = Folder::isSlashTerm('/foo/bar/'); @@ -141,6 +229,10 @@ class FolderTest extends UnitTestCase $this->assertEqual($result, false); } +/** + * Enter description here... + * + */ function testCorrectSlashFor() { $result = Folder::correctSlashFor('/foo/bar/'); @@ -150,6 +242,10 @@ class FolderTest extends UnitTestCase $this->assertEqual($result, '\\'); } +/** + * Enter description here... + * + */ function testSlashTerm() { $result = Folder::slashTerm('/foo/bar/'); diff --git a/tests/libs/helpers/html.php b/tests/libs/helpers/html.php index 91130e35c..d01cd8cb7 100644 --- a/tests/libs/helpers/html.php +++ b/tests/libs/helpers/html.php @@ -1,6 +1,6 @@ + // // + Copyright: (c) 2005, CakePHP Authors/Developers + // @@ -21,11 +21,11 @@ * @copyright Copyright (c) 2005, CakePHP Authors/Developers * @link https://trac.cakephp.org/wiki/Authors Authors/Developers * @package cake - * @subpackage cake.tests.libs + * @subpackage cake.tests.libs.helpers * @since CakePHP v 0.2.9 - * @version $Revision:$ + * @version $Revision$ * @modifiedby $LastChangedBy$ - * @lastmodified $Date:$ + * @lastmodified $Date$ * @license http://www.opensource.org/licenses/mit-license.php The MIT License * */ @@ -38,7 +38,7 @@ uses('helpers/html'); * Enter description here... * * @package cake - * @subpackage cake.tests.libs + * @subpackage cake.tests.libs.helpers * @since CakePHP v .9 * */ @@ -392,10 +392,10 @@ class HtmlHelperTest extends UnitTestCase $this->assertEqual($result, $expected); } - /** - * Enter description here... - * - */ +/** + * Enter description here... + * + */ function testGetCrumbs() { $this->html->addCrumb('Foo', '/bar/foo'); diff --git a/tests/libs/inflector.php b/tests/libs/inflector.php index 51088e910..221b64d5a 100644 --- a/tests/libs/inflector.php +++ b/tests/libs/inflector.php @@ -1,26 +1,88 @@ + // +// + Copyright: (c) 2005, CakePHP Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + 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'); - +/** + * Enter description here... + * + * @package cake + * @subpackage cake.tests.libs + * @since CakePHP v .9 + * + */ class InflectorTest extends UnitTestCase { +/** + * Enter description here... + * + * @var unknown_type + */ var $inflector; +/** + * Enter description here... + * + * @return InflectorTest + */ function InflectorTest() { $this->UnitTestCase('Inflector test'); } +/** + * Enter description here... + * + */ function setUp() { $this->inflector = new Inflector(); } +/** + * Enter description here... + * + */ function tearDown() { unset($this->inflector); } +/** + * Enter description here... + * + */ function testPluralizeSingularize() { $singulars = array( @@ -39,31 +101,55 @@ class InflectorTest extends UnitTestCase } } +/** + * Enter description here... + * + */ function testCamelize() { $this->assertEqual($this->inflector->camelize('foo_bar_baz'), 'FooBarBaz'); } +/** + * Enter description here... + * + */ function testUnderscore() { $this->assertEqual($this->inflector->underscore('FooBarBaz'), 'foo_bar_baz'); } +/** + * Enter description here... + * + */ function testHumanize() { $this->assertEqual($this->inflector->humanize('foo_bar_baz'), 'Foo Bar Baz'); } +/** + * Enter description here... + * + */ function testTableize() { $this->assertEqual($this->inflector->tableize('Bar'), 'bars'); } +/** + * Enter description here... + * + */ function testClassify() { $this->assertEqual($this->inflector->classify('bars'), 'Bar'); } +/** + * Enter description here... + * + */ function testForeignKey() { $this->assertEqual($this->inflector->foreignKey('Bar'), 'bar_id'); diff --git a/tests/libs/neat_array.php b/tests/libs/neat_array.php index 49b5e1e23..070bc00a7 100644 --- a/tests/libs/neat_array.php +++ b/tests/libs/neat_array.php @@ -1,34 +1,89 @@ + // +// + Copyright: (c) 2005, CakePHP Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + 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'); - +/** + * Enter description here... + * + * @package cake + * @subpackage cake.tests.libs + * @since CakePHP v .9 + * + */ class NeatArrayTest extends UnitTestCase { +/** + * Enter description here... + * + * @var unknown_type + */ var $neatArray; - // constructor of the test suite +/** + * Enter description here... + * + * @return NeatArrayTest + */ function NeatArrayTest() { $this->UnitTestCase('NeatArray test'); } - // called before the test functions will be executed - // this function is defined in PHPUnit_TestCase and overwritten - // here +/** + * Enter description here... + * + */ function setUp() { $this->neatArray = new NeatArray(); } - // called after the test functions are executed - // this function is defined in PHPUnit_TestCase and overwritten - // here +/** + * Enter description here... + * + */ function tearDown() { unset($this->neatArray); } +/** + * Enter description here... + * + */ function testInArray() { $a = array('foo'=>' bar ', 'i-am'=>'a'); diff --git a/tests/libs/router.php b/tests/libs/router.php index 74a20efed..624515957 100644 --- a/tests/libs/router.php +++ b/tests/libs/router.php @@ -1,34 +1,89 @@ + // +// + Copyright: (c) 2005, CakePHP Authors/Developers + // +// + Author(s): Michal Tatarynowicz aka Pies + // +// + Larry E. Masters aka PhpNut + // +// + Kamil Dzielinski aka Brego + // +// +------------------------------------------------------------------+ // +// + 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'); - +/** + * Enter description here... + * + * @package cake + * @subpackage cake.tests.libs + * @since CakePHP v .9 + * + */ class RouterTest extends UnitTestCase { +/** + * Enter description here... + * + * @var unknown_type + */ var $router; - // constructor of the test suite +/** + * Enter description here... + * + * @return RouterTest + */ function RouterTest() { $this->UnitTestCase('Router test'); } - // called before the test functions will be executed - // this function is defined in PHPUnit_TestCase and overwritten - // here +/** + * Enter description here... + * + */ function setUp() { $this->router = new Router(); } - // called after the test functions are executed - // this function is defined in PHPUnit_TestCase and overwritten - // here +/** + * Enter description here... + * + */ function tearDown() { unset($this->router); } +/** + * Enter description here... + * + */ function _testConnect() { $tests = array( @@ -43,6 +98,10 @@ class RouterTest extends UnitTestCase } +/** + * Enter description here... + * + */ function testParse () {