CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (GitHub)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • Slack
    • Paid Support
CakePHP

C CakePHP 2.2 API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 2.2
      • 4.2
      • 4.1
      • 4.0
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Packages

  • Cake
    • Cache
      • Engine
    • Configure
    • Console
      • Command
        • Task
    • Controller
      • Component
        • Acl
        • Auth
    • Core
    • Error
    • Event
    • I18n
    • Log
      • Engine
    • Model
      • Behavior
      • Datasource
        • Database
        • Session
      • Validator
    • Network
      • Email
      • Http
    • Routing
      • Filter
      • Route
    • TestSuite
      • Coverage
      • Fixture
      • Reporter
    • Utility
    • View
      • Helper

Classes

  • AclShell
  • ApiShell
  • BakeShell
  • CommandListShell
  • ConsoleShell
  • I18nShell
  • SchemaShell
  • TestShell
  • TestsuiteShell
  • UpgradeShell
  1: <?php
  2: /**
  3:  * Test Suite Shell
  4:  *
  5:  * This is a bc wrapper for the newer Test shell
  6:  *
  7:  * PHP 5
  8:  *
  9:  * CakePHP(tm) Tests <http://book.cakephp.org/2.0/en/development/testing.html>
 10:  * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 11:  *
 12:  * Licensed under The MIT License
 13:  * Redistributions of files must retain the above copyright notice
 14:  *
 15:  * @copyright     Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 16:  * @link          http://book.cakephp.org/2.0/en/development/testing.html
 17:  * @since         CakePHP(tm) v 1.2.0.4433
 18:  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 19:  */
 20: 
 21: App::uses('TestShell', 'Console/Command');
 22: App::uses('AppShell', 'Console/Command');
 23: App::uses('CakeTestSuiteDispatcher', 'TestSuite');
 24: App::uses('CakeTestSuiteCommand', 'TestSuite');
 25: App::uses('CakeTestLoader', 'TestSuite');
 26: 
 27: /**
 28:  * Provides a CakePHP wrapper around PHPUnit.
 29:  * Adds in CakePHP's fixtures and gives access to plugin, app and core test cases
 30:  *
 31:  * @package       Cake.Console.Command
 32:  */
 33: class TestsuiteShell extends TestShell {
 34: 
 35: /**
 36:  * get the option parser for the test suite.
 37:  *
 38:  * @return void
 39:  */
 40:     public function getOptionParser() {
 41:         $parser = parent::getOptionParser();
 42:         $parser->description(array(
 43:             __d('cake_console', 'The CakePHP Testsuite allows you to run test cases from the command line'),
 44:             __d('cake_console', '<warning>This shell is for backwards-compatibility only</warning>'),
 45:             __d('cake_console', 'use the test shell instead')
 46:         ));
 47: 
 48:         return $parser;
 49:     }
 50: 
 51: /**
 52:  * Parse the CLI options into an array CakeTestDispatcher can use.
 53:  *
 54:  * @return array Array of params for CakeTestDispatcher
 55:  */
 56:     protected function _parseArgs() {
 57:         if (empty($this->args)) {
 58:             return;
 59:         }
 60:         $params = array(
 61:             'core' => false,
 62:             'app' => false,
 63:             'plugin' => null,
 64:             'output' => 'text',
 65:         );
 66: 
 67:         $category = $this->args[0];
 68: 
 69:         if ($category == 'core') {
 70:             $params['core'] = true;
 71:         } elseif ($category == 'app') {
 72:             $params['app'] = true;
 73:         } elseif ($category != 'core') {
 74:             $params['plugin'] = $category;
 75:         }
 76: 
 77:         if (isset($this->args[1])) {
 78:             $params['case'] = $this->args[1];
 79:         }
 80:         return $params;
 81:     }
 82: 
 83: /**
 84:  * Main entry point to this shell
 85:  *
 86:  * @return void
 87:  */
 88:     public function main() {
 89:         $this->out(__d('cake_console', 'CakePHP Test Shell'));
 90:         $this->hr();
 91: 
 92:         $args = $this->_parseArgs();
 93: 
 94:         if (empty($args['case'])) {
 95:             return $this->available();
 96:         }
 97: 
 98:         $this->_run($args, $this->_runnerOptions());
 99:     }
100: 
101: }
102: 
OpenHub
Rackspace
Rackspace
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (GitHub)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • Slack
  • Paid Support

Generated using CakePHP API Docs