Skip to content

Commit

Permalink
Make App test cases the default.
Browse files Browse the repository at this point in the history
Fixes #2372
  • Loading branch information
markstory committed Dec 20, 2011
1 parent c272a8b commit c8fd7c0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions lib/Cake/TestSuite/CakeTestLoader.php
Expand Up @@ -61,8 +61,6 @@ protected static function _basePath($params) {
$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 {
Expand All @@ -72,6 +70,8 @@ protected static function _basePath($params) {
} else {
$result = CakePlugin::path($params['plugin']) . 'Test' . DS . 'Case';
}
} elseif (!empty($params['app'])) {
$result = APP_TEST_CASES;
}
return $result;
}
Expand Down
6 changes: 3 additions & 3 deletions lib/Cake/TestSuite/CakeTestSuiteDispatcher.php
Expand Up @@ -37,7 +37,7 @@ class CakeTestSuiteDispatcher {
'codeCoverage' => false,
'case' => null,
'core' => false,
'app' => false,
'app' => true,
'plugin' => null,
'output' => 'html',
'show' => 'groups',
Expand Down Expand Up @@ -214,8 +214,8 @@ function _parseParams() {
$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;
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/TestSuite/Reporter/CakeBaseReporter.php
Expand Up @@ -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.
*
Expand Down
14 changes: 7 additions & 7 deletions lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php
Expand Up @@ -70,14 +70,14 @@ public function paintTestMenu() {
*/
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;
Expand Down Expand Up @@ -177,8 +177,8 @@ protected function _paintLinks() {
$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'];
Expand Down
6 changes: 3 additions & 3 deletions lib/Cake/TestSuite/templates/menu.php
Expand Up @@ -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
Expand All @@ -45,9 +45,9 @@
<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">

0 comments on commit c8fd7c0

Please sign in to comment.