Make App test cases the default.

Fixes #2372
This commit is contained in:
mark_story 2011-12-19 23:13:46 -05:00
parent c272a8b3ca
commit c8fd7c090b
5 changed files with 16 additions and 16 deletions

View file

@ -61,8 +61,6 @@ class CakeTestLoader extends PHPUnit_Runner_StandardTestSuiteLoader {
$result = null;
if (!empty($params['core'])) {
$result = CORE_TEST_CASES;
} elseif (!empty($params['app'])) {
$result = APP_TEST_CASES;
} else if (!empty($params['plugin'])) {
if (!CakePlugin::loaded($params['plugin'])) {
try {
@ -72,6 +70,8 @@ class CakeTestLoader extends PHPUnit_Runner_StandardTestSuiteLoader {
} else {
$result = CakePlugin::path($params['plugin']) . 'Test' . DS . 'Case';
}
} elseif (!empty($params['app'])) {
$result = APP_TEST_CASES;
}
return $result;
}

View file

@ -37,7 +37,7 @@ class CakeTestSuiteDispatcher {
'codeCoverage' => false,
'case' => null,
'core' => false,
'app' => false,
'app' => true,
'plugin' => null,
'output' => 'html',
'show' => 'groups',
@ -214,8 +214,8 @@ class CakeTestSuiteDispatcher {
$this->_checkXdebug();
}
}
if (empty($this->params['plugin']) && empty($this->params['app'])) {
$this->params['core'] = true;
if (empty($this->params['plugin']) && empty($this->params['core'])) {
$this->params['app'] = true;
}
$this->params['baseUrl'] = $this->_baseUrl;
$this->params['baseDir'] = $this->_baseDir;

View file

@ -53,7 +53,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
*
* - show_passes - Should passes be shown
* - plugin - Plugin test being run?
* - app - App test being run.
* - core - Core test being run.
* - case - The case being run
* - codeCoverage - Whether the case/group being run is being code covered.
*

View file

@ -70,14 +70,14 @@ class CakeHtmlReporter extends CakeBaseReporter {
*/
public function testCaseList() {
$testCases = parent::testCaseList();
$app = $this->params['app'];
$core = $this->params['core'];
$plugin = $this->params['plugin'];
$buffer = "<h3>Core Test Cases:</h3>\n<ul>";
$buffer = "<h3>App Test Cases:</h3>\n<ul>";
$urlExtra = null;
if ($app) {
$buffer = "<h3>App Test Cases:</h3>\n<ul>";
$urlExtra = '&app=true';
if ($core) {
$buffer = "<h3>Core Test Cases:</h3>\n<ul>";
$urlExtra = '&core=true';
} elseif ($plugin) {
$buffer = "<h3>" . Inflector::humanize($plugin) . " Test Cases:</h3>\n<ul>";
$urlExtra = '&plugin=' . $plugin;
@ -177,8 +177,8 @@ class CakeHtmlReporter extends CakeBaseReporter {
$show['show'] = 'cases';
}
if (!empty($this->params['app'])) {
$show['app'] = $query['app'] = 'true';
if (!empty($this->params['core'])) {
$show['core'] = $query['core'] = 'true';
}
if (!empty($this->params['plugin'])) {
$show['plugin'] = $query['plugin'] = $this->params['plugin'];

View file

@ -22,7 +22,7 @@
<li>
<span style="font-size: 18px">App</span>
<ul>
<li><a href='<?php echo $cases;?>&amp;app=true'>Tests</a></li>
<li><a href='<?php echo $cases;?>'>Tests</a></li>
</ul>
</li>
<?php
@ -45,9 +45,9 @@ if (!empty($plugins)):
<li style="padding-top: 10px">
<span style="font-size: 18px">Core</span>
<ul>
<li><a href='<?php echo $cases;?>'>Tests</a></li>
<li><a href='<?php echo $cases;?>&amp;core=true'>Tests</a></li>
</ul>
</li>
</ul>
</div>
<div class="test-results">
<div class="test-results">