Skip to content

Commit

Permalink
Fix failing tests.
Browse files Browse the repository at this point in the history
A number of tests have started to fail since App/ was moved. Rework
a number of tests to continue passing with the existing TestApp/
directory.

A number of files have been added/moved and updated, so not many useful
notes can be given.
  • Loading branch information
markstory committed Sep 6, 2013
1 parent fa48d0f commit ef59d04
Show file tree
Hide file tree
Showing 19 changed files with 810 additions and 110 deletions.
10 changes: 7 additions & 3 deletions lib/Cake/Console/Command/TestShell.php
Expand Up @@ -425,11 +425,15 @@ protected function _mapFileToCategory($file) {
}

$file = str_replace(DS, '/', $file);
if (strpos($file, 'lib/Cake/') !== false) {
return 'core';
} elseif (preg_match('@(?:plugins|Plugin)/([^/]*)@', $file, $match)) {
if (preg_match('@(?:plugins|Plugin)/([^/]*)@', $file, $match)) {
return $match[1];
}
if (strpos($file, APP) !== false) {
return 'app';
}
if (file_exists(CAKE . $file) || strpos($file, CAKE) !== false) {
return 'core';
}
return 'app';
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Controller/ErrorController.php
Expand Up @@ -42,7 +42,7 @@ public function __construct($request = null, $response = null) {
parent::__construct($request, $response);
$this->constructClasses();
if (count(Router::extensions()) &&
!$this->Components->attached('RequestHandler')
!isset($this->RequestHandler)
) {
$this->RequestHandler = $this->Components->load('RequestHandler');
}
Expand Down
4 changes: 4 additions & 0 deletions lib/Cake/Test/TestApp/Config/routes.php
Expand Up @@ -27,3 +27,7 @@

Router::parseExtensions('json');
Router::connect('/some_alias', array('controller' => 'tests_apps', 'action' => 'some_method'));

Router::connect('/', ['controller' => 'pages', 'action' => 'display', 'home']);

require CAKE . 'Config/routes.php';
15 changes: 9 additions & 6 deletions lib/Cake/Test/TestApp/View/Layouts/flash.ctp
@@ -1,19 +1,22 @@
<?php
use Cake\Core\Configure;
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<title><?php echo $page_title?></title>
<?php echo $this->Html->charset(); ?>
<title><?php echo $page_title; ?></title>

<?php if (!Cake\Core\Configure::read('debug')) { ?>
<meta http-equiv="Refresh" content="<?php echo $pause?>;url=<?php echo $url?>"/>
<?php } ?>
<?php if (Configure::read('debug') == 0): ?>
<meta http-equiv="Refresh" content="<?php echo $pause; ?>;url=<?php echo $url; ?>"/>
<?php endif; ?>
<style><!--
P { text-align:center; font:bold 1.1em sans-serif }
A { color:#444; text-decoration:none }
A:HOVER { text-decoration: underline; color:#44E }
--></style>
</head>
<body>
<p><a href="<?php echo $url?>"><?php echo $message?></a></p>
<p><a href="<?php echo $url; ?>"><?php echo $message; ?></a></p>
</body>
</html>

0 comments on commit ef59d04

Please sign in to comment.