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.5 API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 2.5
      • 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
  • CompletionShell
  • ConsoleShell
  • I18nShell
  • SchemaShell
  • ServerShell
  • TestShell
  • TestsuiteShell
  • UpgradeShell
  1: <?php
  2: /**
  3:  * Test Suite Shell
  4:  *
  5:  * This is a bc wrapper for the newer Test shell
  6:  *
  7:  * CakePHP(tm) Tests <http://book.cakephp.org/2.0/en/development/testing.html>
  8:  * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  9:  *
 10:  * Licensed under The MIT License
 11:  * For full copyright and license information, please see the LICENSE.txt
 12:  * Redistributions of files must retain the above copyright notice
 13:  *
 14:  * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 15:  * @link          http://book.cakephp.org/2.0/en/development/testing.html
 16:  * @since         CakePHP(tm) v 1.2.0.4433
 17:  * @license       http://www.opensource.org/licenses/mit-license.php MIT License
 18:  */
 19: 
 20: App::uses('TestShell', 'Console/Command');
 21: App::uses('AppShell', 'Console/Command');
 22: App::uses('CakeTestSuiteDispatcher', 'TestSuite');
 23: App::uses('CakeTestSuiteCommand', 'TestSuite');
 24: App::uses('CakeTestLoader', 'TestSuite');
 25: 
 26: /**
 27:  * Provides a CakePHP wrapper around PHPUnit.
 28:  * Adds in CakePHP's fixtures and gives access to plugin, app and core test cases
 29:  *
 30:  * @package       Cake.Console.Command
 31:  */
 32: class TestsuiteShell extends TestShell {
 33: 
 34: /**
 35:  * Gets the option parser instance and configures it.
 36:  *
 37:  * @return ConsoleOptionParser
 38:  */
 39:     public function getOptionParser() {
 40:         $parser = parent::getOptionParser();
 41: 
 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>\nuse the test shell instead")
 45:         ));
 46: 
 47:         return $parser;
 48:     }
 49: 
 50: /**
 51:  * Parse the CLI options into an array CakeTestDispatcher can use.
 52:  *
 53:  * @return array Array of params for CakeTestDispatcher
 54:  */
 55:     protected function _parseArgs() {
 56:         if (empty($this->args)) {
 57:             return;
 58:         }
 59:         $params = array(
 60:             'core' => false,
 61:             'app' => false,
 62:             'plugin' => null,
 63:             'output' => 'text',
 64:         );
 65: 
 66:         $category = $this->args[0];
 67: 
 68:         if ($category === 'core') {
 69:             $params['core'] = true;
 70:         } elseif ($category === 'app') {
 71:             $params['app'] = true;
 72:         } elseif ($category !== 'core') {
 73:             $params['plugin'] = $category;
 74:         }
 75: 
 76:         if (isset($this->args[1])) {
 77:             $params['case'] = $this->args[1];
 78:         }
 79:         return $params;
 80:     }
 81: 
 82: /**
 83:  * Main entry point to this shell
 84:  *
 85:  * @return void
 86:  */
 87:     public function main() {
 88:         $this->out(__d('cake_console', 'CakePHP Test Shell'));
 89:         $this->hr();
 90: 
 91:         $args = $this->_parseArgs();
 92: 
 93:         if (empty($args['case'])) {
 94:             return $this->available();
 95:         }
 96: 
 97:         $this->_run($args, $this->_runnerOptions());
 98:     }
 99: 
100: }
101: 
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