Skip to content

Commit

Permalink
Fixing debug() test making it match truncated paths too.
Browse files Browse the repository at this point in the history
Adding skip to uses() test to make running all tests in sequence more smooth.

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8104 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information
mariuswilms committed Mar 15, 2009
1 parent e3b0272 commit 93bf4fd
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cake/tests/cases/basics.test.php
Expand Up @@ -119,6 +119,8 @@ function testEnv() {
* @return void
*/
function testUses() {
$this->skipIf(class_exists('Security') || class_exists('Sanitize'), 'Security and/or Sanitize class already loaded');

$this->assertFalse(class_exists('Security'));
$this->assertFalse(class_exists('Sanitize'));

Expand Down Expand Up @@ -532,15 +534,17 @@ function testDebug() {
ob_start();
debug('this-is-a-test');
$result = ob_get_clean();
$pattern = '/.*' . preg_quote(substr(__FILE__, 1), '/')
. '.*line.*' . (__LINE__ - 3) . '.*this-is-a-test.*/s';
$pattern = '/.*\>(cake(\/|\\\)tests(\/|\\\)cases(\/|\\\)basics\.test\.php|';
$pattern .= preg_quote(substr(__FILE__, 1), '/') . ')';
$pattern .= '.*line.*' . (__LINE__ - 4) . '.*this-is-a-test.*/s';
$this->assertPattern($pattern, $result);

ob_start();
debug('<div>this-is-a-test</div>', true);
$result = ob_get_clean();
$pattern = '/.*' . preg_quote(substr(__FILE__, 1), '/')
. '.*line.*' . (__LINE__ - 3) . '.*&lt;div&gt;this-is-a-test&lt;\/div&gt;.*/s';
$pattern = '/.*\>(cake(\/|\\\)tests(\/|\\\)cases(\/|\\\)basics\.test\.php|';
$pattern .= preg_quote(substr(__FILE__, 1), '/') . ')';
$pattern .= '.*line.*' . (__LINE__ - 4) . '.*&lt;div&gt;this-is-a-test&lt;\/div&gt;.*/s';
$this->assertPattern($pattern, $result);
}
/**
Expand Down

0 comments on commit 93bf4fd

Please sign in to comment.