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.
*
* @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)
{

View file

@ -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;

View file

@ -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)
{
}

View file

@ -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

View file

@ -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;

View file

@ -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

View file

@ -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

View file

@ -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
*
*/

View file

@ -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');
/**

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
{
/**
* 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)))

View file

@ -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();

View file

@ -1,5 +1,43 @@
<?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
{
}

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 $htmlOptions

View file

@ -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 <aidan@php.net>
* @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)) {

View file

@ -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)
{

View file

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

View file

@ -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)
{

View file

@ -1,27 +1,33 @@
<?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
* @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
*
*/
/**

View file

@ -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 '<div class="error">';
@ -102,6 +114,11 @@ class CakeHtmlReporter extends HtmlReporter
print '<div class="msg">' . $this->_htmlEntities($message) . "</div>\n";
print '</div>';
}
/**
* Enter description here...
*
* @param unknown_type $message
*/
function paintException($message)
{
print '<div class="error">';

View file

@ -1,68 +1,133 @@
<?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');
/**
* 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);
// }*/
//}
}
?>

View file

@ -1,34 +1,89 @@
<?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');
/**
* 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(

View file

@ -1,21 +1,76 @@
<?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');
/**
* 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/');

View file

@ -1,6 +1,6 @@
<?php
//////////////////////////////////////////////////////////////////////////
// + $Id:$
// + $Id$
// +------------------------------------------------------------------+ //
// + Cake PHP : Rapid Development Framework <http://www.cakephp.org/> + //
// + 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');

View file

@ -1,26 +1,88 @@
<?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');
/**
* 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');

View file

@ -1,34 +1,89 @@
<?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');
/**
* 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');

View file

@ -1,34 +1,89 @@
<?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');
/**
* 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 ()
{