mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 00:48:25 +00:00
test: Replace deprecated assertNotRegExp() with assertDoesNotMatchRegularExpression().
Co-authored-by: Kenshin Okinaka <okinakak@yahoo.co.jp>
This commit is contained in:
parent
883ce8041e
commit
6529d5a308
20 changed files with 124 additions and 124 deletions
|
@ -807,7 +807,7 @@ class BasicsTest extends CakeTestCase {
|
|||
|
||||
$result = file_get_contents(LOGS . 'error.log');
|
||||
$this->assertMatchesRegularExpression('/Error: Testing LogError\(\) basic function/', $result);
|
||||
$this->assertNotRegExp("/Error: Testing with\nmulti-line\nstring/", $result);
|
||||
$this->assertDoesNotMatchRegularExpression("/Error: Testing with\nmulti-line\nstring/", $result);
|
||||
$this->assertMatchesRegularExpression('/Error: Testing with multi-line string/', $result);
|
||||
}
|
||||
|
||||
|
|
|
@ -358,8 +358,8 @@ class SchemaShellTest extends CakeTestCase {
|
|||
$this->assertMatchesRegularExpression('/public \$auth_users/', $contents);
|
||||
$this->assertMatchesRegularExpression('/public \$authors/', $contents);
|
||||
$this->assertMatchesRegularExpression('/public \$test_plugin_comments/', $contents);
|
||||
$this->assertNotRegExp('/public \$users/', $contents);
|
||||
$this->assertNotRegExp('/public \$articles/', $contents);
|
||||
$this->assertDoesNotMatchRegularExpression('/public \$users/', $contents);
|
||||
$this->assertDoesNotMatchRegularExpression('/public \$articles/', $contents);
|
||||
CakePlugin::unload();
|
||||
}
|
||||
|
||||
|
@ -391,9 +391,9 @@ class SchemaShellTest extends CakeTestCase {
|
|||
|
||||
$this->assertMatchesRegularExpression('/class TestPluginSchema/', $contents);
|
||||
$this->assertMatchesRegularExpression('/public \$test_plugin_comments/', $contents);
|
||||
$this->assertNotRegExp('/public \$authors/', $contents);
|
||||
$this->assertNotRegExp('/public \$auth_users/', $contents);
|
||||
$this->assertNotRegExp('/public \$posts/', $contents);
|
||||
$this->assertDoesNotMatchRegularExpression('/public \$authors/', $contents);
|
||||
$this->assertDoesNotMatchRegularExpression('/public \$auth_users/', $contents);
|
||||
$this->assertDoesNotMatchRegularExpression('/public \$posts/', $contents);
|
||||
CakePlugin::unload();
|
||||
}
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ class ExtractTaskTest extends CakeTestCase {
|
|||
$this->assertMatchesRegularExpression($pattern, $result);
|
||||
|
||||
$pattern = '/msgid "You have %d new message."\nmsgstr ""/';
|
||||
$this->assertNotRegExp($pattern, $result, 'No duplicate msgid');
|
||||
$this->assertDoesNotMatchRegularExpression($pattern, $result, 'No duplicate msgid');
|
||||
|
||||
$pattern = '/\#: extract\.ctp:7\n';
|
||||
$pattern .= 'msgid "You deleted %d message."\nmsgid_plural "You deleted %d messages."/';
|
||||
|
@ -181,9 +181,9 @@ class ExtractTaskTest extends CakeTestCase {
|
|||
$result = file_get_contents($this->path . DS . 'domain.pot');
|
||||
|
||||
$pattern = '/msgid "You have %d new message."\nmsgid_plural "You have %d new messages."/';
|
||||
$this->assertNotRegExp($pattern, $result);
|
||||
$this->assertDoesNotMatchRegularExpression($pattern, $result);
|
||||
$pattern = '/msgid "You deleted %d message."\nmsgid_plural "You deleted %d messages."/';
|
||||
$this->assertNotRegExp($pattern, $result);
|
||||
$this->assertDoesNotMatchRegularExpression($pattern, $result);
|
||||
|
||||
$pattern = '/msgid "You have %d new message \(domain\)."\nmsgid_plural "You have %d new messages \(domain\)."/';
|
||||
$this->assertMatchesRegularExpression($pattern, $result);
|
||||
|
@ -215,10 +215,10 @@ class ExtractTaskTest extends CakeTestCase {
|
|||
$result = file_get_contents($this->path . DS . 'default.pot');
|
||||
|
||||
$pattern = '/\#: .*extract\.ctp:31\n/';
|
||||
$this->assertNotRegExp($pattern, $result);
|
||||
$this->assertDoesNotMatchRegularExpression($pattern, $result);
|
||||
|
||||
$pattern = '/\#: .*extract\.ctp:33\n/';
|
||||
$this->assertNotRegExp($pattern, $result);
|
||||
$this->assertDoesNotMatchRegularExpression($pattern, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -246,7 +246,7 @@ class ExtractTaskTest extends CakeTestCase {
|
|||
$result = file_get_contents($this->path . DS . 'default.pot');
|
||||
|
||||
$pattern = '/\n\#: .*\n/';
|
||||
$this->assertNotRegExp($pattern, $result);
|
||||
$this->assertDoesNotMatchRegularExpression($pattern, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -270,10 +270,10 @@ class ExtractTaskTest extends CakeTestCase {
|
|||
$result = file_get_contents($this->path . DS . 'default.pot');
|
||||
|
||||
$pattern = '/\#: .*extract\.ctp:6\n/';
|
||||
$this->assertNotRegExp($pattern, $result);
|
||||
$this->assertDoesNotMatchRegularExpression($pattern, $result);
|
||||
|
||||
$pattern = '/\#: .*default\.ctp:26\n/';
|
||||
$this->assertNotRegExp($pattern, $result);
|
||||
$this->assertDoesNotMatchRegularExpression($pattern, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -323,7 +323,7 @@ class ExtractTaskTest extends CakeTestCase {
|
|||
|
||||
$this->Task->execute();
|
||||
$result = file_get_contents($this->path . DS . 'default.pot');
|
||||
$this->assertNotRegExp('#TestPlugin#', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('#TestPlugin#', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -348,7 +348,7 @@ class ExtractTaskTest extends CakeTestCase {
|
|||
|
||||
$this->Task->execute();
|
||||
$result = file_get_contents($this->path . DS . 'default.pot');
|
||||
$this->assertNotRegExp('#Pages#', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('#Pages#', $result);
|
||||
$this->assertContains('translate.ctp:1', $result);
|
||||
$this->assertContains('This is a translatable string', $result);
|
||||
$this->assertContains('I can haz plugin model validation message', $result);
|
||||
|
@ -498,9 +498,9 @@ class ExtractTaskTest extends CakeTestCase {
|
|||
$result = file_get_contents($this->path . DS . 'cake_dev.pot');
|
||||
|
||||
$pattern = '/#: Console\/Templates\//';
|
||||
$this->assertNotRegExp($pattern, $result);
|
||||
$this->assertDoesNotMatchRegularExpression($pattern, $result);
|
||||
|
||||
$pattern = '/#: Test\//';
|
||||
$this->assertNotRegExp($pattern, $result);
|
||||
$this->assertDoesNotMatchRegularExpression($pattern, $result);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -227,7 +227,7 @@ class ProjectTaskTest extends CakeTestCase {
|
|||
|
||||
$File = new File($path . 'Config' . DS . 'core.php');
|
||||
$contents = $File->read();
|
||||
$this->assertNotRegExp('/DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi/', $contents, 'Default Salt left behind. %s');
|
||||
$this->assertDoesNotMatchRegularExpression('/DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi/', $contents, 'Default Salt left behind. %s');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -244,7 +244,7 @@ class ProjectTaskTest extends CakeTestCase {
|
|||
|
||||
$File = new File($path . 'Config' . DS . 'core.php');
|
||||
$contents = $File->read();
|
||||
$this->assertNotRegExp('/76859309657453542496749683645/', $contents, 'Default CipherSeed left behind. %s');
|
||||
$this->assertDoesNotMatchRegularExpression('/76859309657453542496749683645/', $contents, 'Default CipherSeed left behind. %s');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -262,7 +262,7 @@ class ProjectTaskTest extends CakeTestCase {
|
|||
$File = new File($path . 'Config' . DS . 'core.php');
|
||||
$contents = $File->read();
|
||||
$this->assertMatchesRegularExpression('/\$prefix = \'.+\';/', $contents, '$prefix is not defined');
|
||||
$this->assertNotRegExp('/\$prefix = \'myapp_\';/', $contents, 'Default cache prefix left behind. %s');
|
||||
$this->assertDoesNotMatchRegularExpression('/\$prefix = \'myapp_\';/', $contents, 'Default cache prefix left behind. %s');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -278,10 +278,10 @@ class ProjectTaskTest extends CakeTestCase {
|
|||
|
||||
$File = new File($path . 'webroot' . DS . 'index.php');
|
||||
$contents = $File->read();
|
||||
$this->assertNotRegExp('/define\(\'CAKE_CORE_INCLUDE_PATH\', ROOT/', $contents);
|
||||
$this->assertDoesNotMatchRegularExpression('/define\(\'CAKE_CORE_INCLUDE_PATH\', ROOT/', $contents);
|
||||
$File = new File($path . 'webroot' . DS . 'test.php');
|
||||
$contents = $File->read();
|
||||
$this->assertNotRegExp('/define\(\'CAKE_CORE_INCLUDE_PATH\', ROOT/', $contents);
|
||||
$this->assertDoesNotMatchRegularExpression('/define\(\'CAKE_CORE_INCLUDE_PATH\', ROOT/', $contents);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -380,6 +380,6 @@ class ProjectTaskTest extends CakeTestCase {
|
|||
|
||||
$File = new File($path . 'Console' . DS . 'cake.php');
|
||||
$contents = $File->read();
|
||||
$this->assertNotRegExp('/__CAKE_PATH__/', $contents, 'Console path placeholder left behind.');
|
||||
$this->assertDoesNotMatchRegularExpression('/__CAKE_PATH__/', $contents, 'Console path placeholder left behind.');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -731,14 +731,14 @@ HTMLBLOC;
|
|||
$this->Controller->EmailTest->sendAs = 'html';
|
||||
$this->assertTrue($this->Controller->EmailTest->send($body));
|
||||
$msg = DebugCompTransport::$lastEmail;
|
||||
$this->assertNotRegExp('/text\/plain/', $msg);
|
||||
$this->assertDoesNotMatchRegularExpression('/text\/plain/', $msg);
|
||||
$this->assertMatchesRegularExpression('/text\/html/', $msg);
|
||||
|
||||
$this->Controller->EmailTest->sendAs = 'text';
|
||||
$this->assertTrue($this->Controller->EmailTest->send($body));
|
||||
$msg = DebugCompTransport::$lastEmail;
|
||||
$this->assertMatchesRegularExpression('/text\/plain/', $msg);
|
||||
$this->assertNotRegExp('/text\/html/', $msg);
|
||||
$this->assertDoesNotMatchRegularExpression('/text\/html/', $msg);
|
||||
|
||||
$this->Controller->EmailTest->sendAs = 'both';
|
||||
$this->assertTrue($this->Controller->EmailTest->send($body));
|
||||
|
@ -767,7 +767,7 @@ HTMLBLOC;
|
|||
$this->assertTrue($this->Controller->EmailTest->send($body));
|
||||
$msg = DebugCompTransport::$lastEmail;
|
||||
|
||||
$this->assertNotRegExp('/\n\nContent-Transfer-Encoding/', $msg);
|
||||
$this->assertDoesNotMatchRegularExpression('/\n\nContent-Transfer-Encoding/', $msg);
|
||||
$this->assertMatchesRegularExpression('/\nContent-Transfer-Encoding/', $msg);
|
||||
}
|
||||
|
||||
|
@ -881,7 +881,7 @@ HTMLBLOC;
|
|||
$this->assertTrue($this->Controller->EmailTest->send('This is the body of the message'));
|
||||
$result = DebugCompTransport::$lastEmail;
|
||||
|
||||
$this->assertNotRegExp('/Message-ID:/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/Message-ID:/', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -376,7 +376,7 @@ class ScaffoldTest extends CakeTestCase {
|
|||
$this->Controller->response->send();
|
||||
$result = ob_get_clean();
|
||||
|
||||
$this->assertNotRegExp('/textarea name="data\[ScaffoldMock\]\[body\]" cols="30" rows="6" id="ScaffoldMockBody"/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/textarea name="data\[ScaffoldMock\]\[body\]" cols="30" rows="6" id="ScaffoldMockBody"/', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -452,8 +452,8 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
$ExceptionRenderer->render();
|
||||
$result = ob_get_clean();
|
||||
|
||||
$this->assertNotRegExp('#<script>document#', $result);
|
||||
$this->assertNotRegExp('#alert\(t\);</script>#', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('#<script>document#', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('#alert\(t\);</script>#', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -530,7 +530,7 @@ class PostgresTest extends CakeTestCase {
|
|||
));
|
||||
|
||||
$result = $this->Dbo->createSchema($schema);
|
||||
$this->assertNotRegExp('/^CREATE INDEX(.+);,$/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/^CREATE INDEX(.+);,$/', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -566,7 +566,7 @@ class PostgresTest extends CakeTestCase {
|
|||
);
|
||||
$result = $db1->createSchema($schema, 'datatype_tests');
|
||||
|
||||
$this->assertNotRegExp('/timestamp DEFAULT/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/timestamp DEFAULT/', $result);
|
||||
$this->assertMatchesRegularExpression('/\"full_length\"\s*text\s.*,/', $result);
|
||||
$this->assertContains('timestamp ,', $result);
|
||||
$this->assertContains('"huge_int" bigint NOT NULL,', $result);
|
||||
|
@ -709,7 +709,7 @@ class PostgresTest extends CakeTestCase {
|
|||
)
|
||||
));
|
||||
$result = $this->Dbo->alterSchema($New->compare($Old), 'alter_posts');
|
||||
$this->assertNotRegExp('/varchar\(36\) NOT NULL/i', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/varchar\(36\) NOT NULL/i', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -645,7 +645,7 @@ class SqlserverTest extends CakeTestCase {
|
|||
$this->db->update($this->model, $fields, null, $conditions);
|
||||
|
||||
$result = $this->db->getLastQuery();
|
||||
$this->assertNotRegExp('/SqlserverTestModel/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/SqlserverTestModel/', $result);
|
||||
$this->assertMatchesRegularExpression('/^UPDATE \[sqlserver_test_models\]/', $result);
|
||||
$this->assertMatchesRegularExpression('/SET \[client_id\] = \[client_id\] \+ 1/', $result);
|
||||
}
|
||||
|
|
|
@ -7351,7 +7351,7 @@ class ModelReadTest extends BaseModelTest {
|
|||
|
||||
$log = $this->db->getLog();
|
||||
$this->assertTrue(isset($log['log'][0]['query']));
|
||||
$this->assertNotRegExp('/ORDER\s+BY/', $log['log'][0]['query']);
|
||||
$this->assertDoesNotMatchRegularExpression('/ORDER\s+BY/', $log['log'][0]['query']);
|
||||
|
||||
$Article = new Article();
|
||||
$Article->order = null;
|
||||
|
|
|
@ -67,16 +67,16 @@ class CakeRouteTest extends CakeTestCase {
|
|||
|
||||
$this->assertMatchesRegularExpression($result, '/posts/edit');
|
||||
$this->assertMatchesRegularExpression($result, '/posts/super_delete');
|
||||
$this->assertNotRegExp($result, '/posts');
|
||||
$this->assertNotRegExp($result, '/posts/super_delete/1');
|
||||
$this->assertDoesNotMatchRegularExpression($result, '/posts');
|
||||
$this->assertDoesNotMatchRegularExpression($result, '/posts/super_delete/1');
|
||||
|
||||
$route = new CakeRoute('/posts/foo:id', array('controller' => 'posts', 'action' => 'view'));
|
||||
$result = $route->compile();
|
||||
|
||||
$this->assertMatchesRegularExpression($result, '/posts/foo:1');
|
||||
$this->assertMatchesRegularExpression($result, '/posts/foo:param');
|
||||
$this->assertNotRegExp($result, '/posts');
|
||||
$this->assertNotRegExp($result, '/posts/');
|
||||
$this->assertDoesNotMatchRegularExpression($result, '/posts');
|
||||
$this->assertDoesNotMatchRegularExpression($result, '/posts/');
|
||||
|
||||
$this->assertEquals(array('id'), $route->keys);
|
||||
|
||||
|
@ -116,8 +116,8 @@ class CakeRouteTest extends CakeTestCase {
|
|||
$result = $route->compile();
|
||||
$this->assertMatchesRegularExpression($result, '/posts/edit/1');
|
||||
$this->assertMatchesRegularExpression($result, '/posts/view/518098');
|
||||
$this->assertNotRegExp($result, '/posts/edit/name-of-post');
|
||||
$this->assertNotRegExp($result, '/posts/edit/4/other:param');
|
||||
$this->assertDoesNotMatchRegularExpression($result, '/posts/edit/name-of-post');
|
||||
$this->assertDoesNotMatchRegularExpression($result, '/posts/edit/4/other:param');
|
||||
$this->assertEquals(array('id', 'controller', 'action'), $route->keys);
|
||||
|
||||
$route = new CakeRoute(
|
||||
|
@ -128,8 +128,8 @@ class CakeRouteTest extends CakeTestCase {
|
|||
$result = $route->compile();
|
||||
$this->assertMatchesRegularExpression($result, '/eng/posts/edit/1');
|
||||
$this->assertMatchesRegularExpression($result, '/cze/articles/view/1');
|
||||
$this->assertNotRegExp($result, '/language/articles/view/2');
|
||||
$this->assertNotRegExp($result, '/eng/articles/view/name-of-article');
|
||||
$this->assertDoesNotMatchRegularExpression($result, '/language/articles/view/2');
|
||||
$this->assertDoesNotMatchRegularExpression($result, '/eng/articles/view/name-of-article');
|
||||
$this->assertEquals(array('lang', 'id', 'controller', 'action'), $route->keys);
|
||||
|
||||
foreach (array(':', '@', ';', '$', '-') as $delim) {
|
||||
|
@ -138,8 +138,8 @@ class CakeRouteTest extends CakeTestCase {
|
|||
|
||||
$this->assertMatchesRegularExpression($result, '/posts/1' . $delim . 'name-of-article');
|
||||
$this->assertMatchesRegularExpression($result, '/posts/13244' . $delim . 'name-of_Article[]');
|
||||
$this->assertNotRegExp($result, '/posts/11!nameofarticle');
|
||||
$this->assertNotRegExp($result, '/posts/11');
|
||||
$this->assertDoesNotMatchRegularExpression($result, '/posts/11!nameofarticle');
|
||||
$this->assertDoesNotMatchRegularExpression($result, '/posts/11');
|
||||
|
||||
$this->assertEquals(array('title', 'id'), $route->keys);
|
||||
}
|
||||
|
@ -152,9 +152,9 @@ class CakeRouteTest extends CakeTestCase {
|
|||
$result = $route->compile();
|
||||
$this->assertMatchesRegularExpression($result, '/posts/1:name-of-article/2009/');
|
||||
$this->assertMatchesRegularExpression($result, '/posts/13244:name-of-article/1999');
|
||||
$this->assertNotRegExp($result, '/posts/hey_now:nameofarticle');
|
||||
$this->assertNotRegExp($result, '/posts/:nameofarticle/2009');
|
||||
$this->assertNotRegExp($result, '/posts/:nameofarticle/01');
|
||||
$this->assertDoesNotMatchRegularExpression($result, '/posts/hey_now:nameofarticle');
|
||||
$this->assertDoesNotMatchRegularExpression($result, '/posts/:nameofarticle/2009');
|
||||
$this->assertDoesNotMatchRegularExpression($result, '/posts/:nameofarticle/01');
|
||||
$this->assertEquals(array('year', 'title', 'id'), $route->keys);
|
||||
|
||||
$route = new CakeRoute(
|
||||
|
@ -165,9 +165,9 @@ class CakeRouteTest extends CakeTestCase {
|
|||
$result = $route->compile();
|
||||
$this->assertMatchesRegularExpression($result, '/posts/some_title_for_article-(uuid:12534)/');
|
||||
$this->assertMatchesRegularExpression($result, '/posts/some_title_for_article-(uuid:12534)');
|
||||
$this->assertNotRegExp($result, '/posts/');
|
||||
$this->assertNotRegExp($result, '/posts/nameofarticle');
|
||||
$this->assertNotRegExp($result, '/posts/nameofarticle-12347');
|
||||
$this->assertDoesNotMatchRegularExpression($result, '/posts/');
|
||||
$this->assertDoesNotMatchRegularExpression($result, '/posts/nameofarticle');
|
||||
$this->assertDoesNotMatchRegularExpression($result, '/posts/nameofarticle-12347');
|
||||
$this->assertEquals(array('url_title', 'id'), $route->keys);
|
||||
}
|
||||
|
||||
|
@ -223,11 +223,11 @@ class CakeRouteTest extends CakeTestCase {
|
|||
$this->assertFalse($route->parse('/chaw_test/wiki'));
|
||||
|
||||
$result = $route->compile();
|
||||
$this->assertNotRegExp($result, '/some_project/source');
|
||||
$this->assertDoesNotMatchRegularExpression($result, '/some_project/source');
|
||||
$this->assertMatchesRegularExpression($result, '/source/view');
|
||||
$this->assertMatchesRegularExpression($result, '/source/view/other/params');
|
||||
$this->assertNotRegExp($result, '/chaw_test/wiki');
|
||||
$this->assertNotRegExp($result, '/source/wierd_action');
|
||||
$this->assertDoesNotMatchRegularExpression($result, '/chaw_test/wiki');
|
||||
$this->assertDoesNotMatchRegularExpression($result, '/source/wierd_action');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -646,6 +646,6 @@ TEXT;
|
|||
$result = Debugger::trace(array(
|
||||
'exclude' => array('DebuggerTest::testTraceExclude')
|
||||
));
|
||||
$this->assertNotRegExp('/^DebuggerTest::testTraceExclude/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/^DebuggerTest::testTraceExclude/', $result);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -164,7 +164,7 @@ class XmlTest extends CakeTestCase {
|
|||
$this->assertEquals('value', $obj->firstChild->nodeValue);
|
||||
|
||||
$obj = Xml::build($xml, array('return' => 'domdocument', 'encoding' => null));
|
||||
$this->assertNotRegExp('/encoding/', $obj->saveXML());
|
||||
$this->assertDoesNotMatchRegularExpression('/encoding/', $obj->saveXML());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -118,8 +118,8 @@ class CacheHelperTest extends CakeTestCase {
|
|||
|
||||
$View = new View($this->Controller);
|
||||
$result = $View->render('index');
|
||||
$this->assertNotRegExp('/cake:nocache/', $result);
|
||||
$this->assertNotRegExp('/php echo/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/cake:nocache/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/php echo/', $result);
|
||||
|
||||
$filename = CACHE . 'views' . DS . 'cachetest_cache_parsing.php';
|
||||
$this->assertTrue(file_exists($filename));
|
||||
|
@ -177,8 +177,8 @@ class CacheHelperTest extends CakeTestCase {
|
|||
|
||||
$View = new View($this->Controller);
|
||||
$result = $View->render('test_nocache_tags');
|
||||
$this->assertNotRegExp('/cake:nocache/', $result);
|
||||
$this->assertNotRegExp('/php echo/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/cake:nocache/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/php echo/', $result);
|
||||
|
||||
$filename = CACHE . 'views' . DS . 'cachetest_cache_parsing.php';
|
||||
$this->assertTrue(file_exists($filename));
|
||||
|
@ -187,7 +187,7 @@ class CacheHelperTest extends CakeTestCase {
|
|||
$this->assertMatchesRegularExpression('/if \(is_writable\(TMP\)\)\:/', $contents);
|
||||
$this->assertMatchesRegularExpression('/php echo \$variable/', $contents);
|
||||
$this->assertMatchesRegularExpression('/php echo microtime()/', $contents);
|
||||
$this->assertNotRegExp('/cake:nocache/', $contents);
|
||||
$this->assertDoesNotMatchRegularExpression('/cake:nocache/', $contents);
|
||||
|
||||
unlink($filename);
|
||||
}
|
||||
|
@ -212,14 +212,14 @@ class CacheHelperTest extends CakeTestCase {
|
|||
$View = new View($this->Controller);
|
||||
$result = $View->render('multiple_nocache');
|
||||
|
||||
$this->assertNotRegExp('/cake:nocache/', $result);
|
||||
$this->assertNotRegExp('/php echo/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/cake:nocache/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/php echo/', $result);
|
||||
|
||||
$filename = CACHE . 'views' . DS . 'cachetest_cache_parsing.php';
|
||||
$this->assertTrue(file_exists($filename));
|
||||
|
||||
$contents = file_get_contents($filename);
|
||||
$this->assertNotRegExp('/cake:nocache/', $contents);
|
||||
$this->assertDoesNotMatchRegularExpression('/cake:nocache/', $contents);
|
||||
unlink($filename);
|
||||
}
|
||||
|
||||
|
@ -245,8 +245,8 @@ class CacheHelperTest extends CakeTestCase {
|
|||
$View = new View($this->Controller);
|
||||
$result = $View->render('sequencial_nocache');
|
||||
|
||||
$this->assertNotRegExp('/cake:nocache/', $result);
|
||||
$this->assertNotRegExp('/php echo/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/cake:nocache/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/php echo/', $result);
|
||||
$this->assertMatchesRegularExpression('/A\. Layout Before Content/', $result);
|
||||
$this->assertMatchesRegularExpression('/B\. In Plain Element/', $result);
|
||||
$this->assertMatchesRegularExpression('/C\. Layout After Test Element/', $result);
|
||||
|
@ -254,13 +254,13 @@ class CacheHelperTest extends CakeTestCase {
|
|||
$this->assertMatchesRegularExpression('/E\. Layout After Content/', $result);
|
||||
$this->assertMatchesRegularExpression('/F\. In Element With No Cache Tags/', $result);
|
||||
$this->assertMatchesRegularExpression('/G\. Layout After Content And After Element With No Cache Tags/', $result);
|
||||
$this->assertNotRegExp('/1\. layout before content/', $result);
|
||||
$this->assertNotRegExp('/2\. in plain element/', $result);
|
||||
$this->assertNotRegExp('/3\. layout after test element/', $result);
|
||||
$this->assertNotRegExp('/4\. in view file/', $result);
|
||||
$this->assertNotRegExp('/5\. layout after content/', $result);
|
||||
$this->assertNotRegExp('/6\. in element with no cache tags/', $result);
|
||||
$this->assertNotRegExp('/7\. layout after content and after element with no cache tags/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/1\. layout before content/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/2\. in plain element/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/3\. layout after test element/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/4\. in view file/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/5\. layout after content/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/6\. in element with no cache tags/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/7\. layout after content and after element with no cache tags/', $result);
|
||||
|
||||
$filename = CACHE . 'views' . DS . 'cachetest_cache_complex.php';
|
||||
$this->assertTrue(file_exists($filename));
|
||||
|
@ -268,14 +268,14 @@ class CacheHelperTest extends CakeTestCase {
|
|||
unlink($filename);
|
||||
|
||||
$this->assertMatchesRegularExpression('/A\. Layout Before Content/', $contents);
|
||||
$this->assertNotRegExp('/B\. In Plain Element/', $contents);
|
||||
$this->assertDoesNotMatchRegularExpression('/B\. In Plain Element/', $contents);
|
||||
$this->assertMatchesRegularExpression('/C\. Layout After Test Element/', $contents);
|
||||
$this->assertMatchesRegularExpression('/D\. In View File/', $contents);
|
||||
$this->assertMatchesRegularExpression('/E\. Layout After Content/', $contents);
|
||||
$this->assertMatchesRegularExpression('/F\. In Element With No Cache Tags/', $contents);
|
||||
$this->assertMatchesRegularExpression('/G\. Layout After Content And After Element With No Cache Tags/', $contents);
|
||||
$this->assertMatchesRegularExpression('/1\. layout before content/', $contents);
|
||||
$this->assertNotRegExp('/2\. in plain element/', $contents);
|
||||
$this->assertDoesNotMatchRegularExpression('/2\. in plain element/', $contents);
|
||||
$this->assertMatchesRegularExpression('/3\. layout after test element/', $contents);
|
||||
$this->assertMatchesRegularExpression('/4\. in view file/', $contents);
|
||||
$this->assertMatchesRegularExpression('/5\. layout after content/', $contents);
|
||||
|
@ -301,8 +301,8 @@ class CacheHelperTest extends CakeTestCase {
|
|||
|
||||
$View = new View($this->Controller);
|
||||
$result = $View->render('index');
|
||||
$this->assertNotRegExp('/cake:nocache/', $result);
|
||||
$this->assertNotRegExp('/php echo/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/cake:nocache/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/php echo/', $result);
|
||||
|
||||
$filename = CACHE . 'views' . DS . 'cachetest_cache_parsing.php';
|
||||
$this->assertTrue(file_exists($filename));
|
||||
|
@ -371,8 +371,8 @@ class CacheHelperTest extends CakeTestCase {
|
|||
$View = new View($this->Controller);
|
||||
$result = $View->render('index');
|
||||
|
||||
$this->assertNotRegExp('/cake:nocache/', $result);
|
||||
$this->assertNotRegExp('/php echo/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/cake:nocache/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/php echo/', $result);
|
||||
|
||||
$filename = CACHE . 'views' . DS . 'cache_test_cache_parsing.php';
|
||||
$this->assertTrue(file_exists($filename));
|
||||
|
@ -400,8 +400,8 @@ class CacheHelperTest extends CakeTestCase {
|
|||
$View = new View($this->Controller);
|
||||
$result = $View->render('index');
|
||||
|
||||
$this->assertNotRegExp('/cake:nocache/', $result);
|
||||
$this->assertNotRegExp('/php echo/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/cake:nocache/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/php echo/', $result);
|
||||
|
||||
$filename = CACHE . 'views' . DS . 'cachetest_cache_parsing.php';
|
||||
$this->assertTrue(file_exists($filename));
|
||||
|
@ -434,8 +434,8 @@ class CacheHelperTest extends CakeTestCase {
|
|||
$View = new View($this->Controller);
|
||||
$result = $View->render('index');
|
||||
|
||||
$this->assertNotRegExp('/cake:nocache/', $result);
|
||||
$this->assertNotRegExp('/php echo/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/cake:nocache/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/php echo/', $result);
|
||||
|
||||
$filename = CACHE . 'views' . DS . 'cache_test_cache_parsing_1_2_name_mark_ice_cream.php';
|
||||
$this->assertTrue(file_exists($filename));
|
||||
|
@ -466,8 +466,8 @@ class CacheHelperTest extends CakeTestCase {
|
|||
$View = new View($this->Controller);
|
||||
$result = $View->render('index');
|
||||
|
||||
$this->assertNotRegExp('/cake:nocache/', $result);
|
||||
$this->assertNotRegExp('/php echo/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/cake:nocache/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/php echo/', $result);
|
||||
|
||||
$filename = CACHE . 'views' . DS . 'cache_test_cache_parsing_q_cakephp.php';
|
||||
$this->assertTrue(file_exists($filename), 'Missing cache file ' . $filename);
|
||||
|
@ -500,8 +500,8 @@ class CacheHelperTest extends CakeTestCase {
|
|||
$View = new View($this->Controller);
|
||||
$result = $View->render('index');
|
||||
|
||||
$this->assertNotRegExp('/cake:nocache/', $result);
|
||||
$this->assertNotRegExp('/php echo/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/cake:nocache/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/php echo/', $result);
|
||||
|
||||
$filename = CACHE . 'views' . DS . 'en_cache_test_cache_parsing.php';
|
||||
$this->assertTrue(file_exists($filename));
|
||||
|
@ -535,8 +535,8 @@ class CacheHelperTest extends CakeTestCase {
|
|||
$View = new View($this->Controller);
|
||||
$result = $View->render('index');
|
||||
|
||||
$this->assertNotRegExp('/cake:nocache/', $result);
|
||||
$this->assertNotRegExp('/php echo/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/cake:nocache/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/php echo/', $result);
|
||||
|
||||
$filename = CACHE . 'views' . DS . 'cache_cachetest_cache_name.php';
|
||||
$this->assertTrue(file_exists($filename));
|
||||
|
@ -620,8 +620,8 @@ class CacheHelperTest extends CakeTestCase {
|
|||
|
||||
$View = new View($this->Controller);
|
||||
$result = $View->render('cache_empty_sections');
|
||||
$this->assertNotRegExp('/nocache/', $result);
|
||||
$this->assertNotRegExp('/php echo/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/nocache/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/php echo/', $result);
|
||||
$this->assertMatchesRegularExpression(
|
||||
'@</title>\s*</head>\s*' .
|
||||
'<body>\s*' .
|
||||
|
@ -632,7 +632,7 @@ class CacheHelperTest extends CakeTestCase {
|
|||
$filename = CACHE . 'views' . DS . 'cachetest_cache_empty_sections.php';
|
||||
$this->assertTrue(file_exists($filename));
|
||||
$contents = file_get_contents($filename);
|
||||
$this->assertNotRegExp('/nocache/', $contents);
|
||||
$this->assertDoesNotMatchRegularExpression('/nocache/', $contents);
|
||||
$this->assertMatchesRegularExpression(
|
||||
'@<head>\s*<title>Posts</title>\s*' .
|
||||
'<\?php \$x \= 1; \?>\s*' .
|
||||
|
|
|
@ -2909,27 +2909,27 @@ class FormHelperTest extends CakeTestCase {
|
|||
$result = $this->Form->input('Contact.created', array('type' => 'time', 'timeFormat' => 24));
|
||||
$result = explode(':', $result);
|
||||
$this->assertMatchesRegularExpression('/option value="23"/', $result[0]);
|
||||
$this->assertNotRegExp('/option value="24"/', $result[0]);
|
||||
$this->assertDoesNotMatchRegularExpression('/option value="24"/', $result[0]);
|
||||
|
||||
$result = $this->Form->input('Contact.created', array('type' => 'time', 'timeFormat' => 24));
|
||||
$result = explode(':', $result);
|
||||
$this->assertMatchesRegularExpression('/option value="23"/', $result[0]);
|
||||
$this->assertNotRegExp('/option value="24"/', $result[0]);
|
||||
$this->assertDoesNotMatchRegularExpression('/option value="24"/', $result[0]);
|
||||
|
||||
$result = $this->Form->input('Model.field', array(
|
||||
'type' => 'time', 'timeFormat' => 24, 'interval' => 15
|
||||
));
|
||||
$result = explode(':', $result);
|
||||
$this->assertNotRegExp('#<option value="12"[^>]*>12</option>#', $result[1]);
|
||||
$this->assertNotRegExp('#<option value="50"[^>]*>50</option>#', $result[1]);
|
||||
$this->assertDoesNotMatchRegularExpression('#<option value="12"[^>]*>12</option>#', $result[1]);
|
||||
$this->assertDoesNotMatchRegularExpression('#<option value="50"[^>]*>50</option>#', $result[1]);
|
||||
$this->assertMatchesRegularExpression('#<option value="15"[^>]*>15</option>#', $result[1]);
|
||||
|
||||
$result = $this->Form->input('Model.field', array(
|
||||
'type' => 'time', 'timeFormat' => 12, 'interval' => 15
|
||||
));
|
||||
$result = explode(':', $result);
|
||||
$this->assertNotRegExp('#<option value="12"[^>]*>12</option>#', $result[1]);
|
||||
$this->assertNotRegExp('#<option value="50"[^>]*>50</option>#', $result[1]);
|
||||
$this->assertDoesNotMatchRegularExpression('#<option value="12"[^>]*>12</option>#', $result[1]);
|
||||
$this->assertDoesNotMatchRegularExpression('#<option value="50"[^>]*>50</option>#', $result[1]);
|
||||
$this->assertMatchesRegularExpression('#<option value="15"[^>]*>15</option>#', $result[1]);
|
||||
|
||||
$result = $this->Form->input('prueba', array(
|
||||
|
@ -2937,8 +2937,8 @@ class FormHelperTest extends CakeTestCase {
|
|||
'maxYear' => date('Y') + 1, 'interval' => 15
|
||||
));
|
||||
$result = explode(':', $result);
|
||||
$this->assertNotRegExp('#<option value="12"[^>]*>12</option>#', $result[1]);
|
||||
$this->assertNotRegExp('#<option value="50"[^>]*>50</option>#', $result[1]);
|
||||
$this->assertDoesNotMatchRegularExpression('#<option value="12"[^>]*>12</option>#', $result[1]);
|
||||
$this->assertDoesNotMatchRegularExpression('#<option value="50"[^>]*>50</option>#', $result[1]);
|
||||
$this->assertMatchesRegularExpression('#<option value="15"[^>]*>15</option>#', $result[1]);
|
||||
$this->assertMatchesRegularExpression('#<option value="30"[^>]*>30</option>#', $result[1]);
|
||||
|
||||
|
@ -3213,8 +3213,8 @@ class FormHelperTest extends CakeTestCase {
|
|||
'maxYear' => date('Y') + 1, 'interval' => 15
|
||||
));
|
||||
$result = explode(':', $result);
|
||||
$this->assertNotRegExp('#<option value="12"[^>]*>12</option>#', $result[1]);
|
||||
$this->assertNotRegExp('#<option value="50"[^>]*>50</option>#', $result[1]);
|
||||
$this->assertDoesNotMatchRegularExpression('#<option value="12"[^>]*>12</option>#', $result[1]);
|
||||
$this->assertDoesNotMatchRegularExpression('#<option value="50"[^>]*>50</option>#', $result[1]);
|
||||
$this->assertMatchesRegularExpression('#<option value="15"[^>]*>15</option>#', $result[1]);
|
||||
$this->assertMatchesRegularExpression('#<option value="30"[^>]*>30</option>#', $result[1]);
|
||||
|
||||
|
@ -3240,7 +3240,7 @@ class FormHelperTest extends CakeTestCase {
|
|||
$result = explode('</select><select', $result);
|
||||
$result = explode(':', $result[1]);
|
||||
$this->assertMatchesRegularExpression('/option value="23"/', $result[0]);
|
||||
$this->assertNotRegExp('/option value="24"/', $result[0]);
|
||||
$this->assertDoesNotMatchRegularExpression('/option value="24"/', $result[0]);
|
||||
|
||||
$result = $this->Form->input('Model.field', array(
|
||||
'type' => 'datetime', 'timeFormat' => 12
|
||||
|
@ -3248,7 +3248,7 @@ class FormHelperTest extends CakeTestCase {
|
|||
$result = explode('</select><select', $result);
|
||||
$result = explode(':', $result[1]);
|
||||
$this->assertMatchesRegularExpression('/option value="12"/', $result[0]);
|
||||
$this->assertNotRegExp('/option value="13"/', $result[0]);
|
||||
$this->assertDoesNotMatchRegularExpression('/option value="13"/', $result[0]);
|
||||
|
||||
$this->Form->request->data = array('Contact' => array('created' => null));
|
||||
$result = $this->Form->input('Contact.created', array('empty' => 'Date Unknown'));
|
||||
|
@ -6976,15 +6976,15 @@ class FormHelperTest extends CakeTestCase {
|
|||
'*/select'
|
||||
);
|
||||
$this->assertTags($result, $expected);
|
||||
$this->assertNotRegExp('/<option[^<>]+value=""[^<>]+selected="selected"[^>]*>/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/<option[^<>]+value=""[^<>]+selected="selected"[^>]*>/', $result);
|
||||
|
||||
$result = $this->Form->dateTime('Contact.date', 'DMY', '12', array('value' => false));
|
||||
$this->assertTags($result, $expected);
|
||||
$this->assertNotRegExp('/<option[^<>]+value=""[^<>]+selected="selected"[^>]*>/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/<option[^<>]+value=""[^<>]+selected="selected"[^>]*>/', $result);
|
||||
|
||||
$result = $this->Form->dateTime('Contact.date', 'DMY', '12', array('value' => ''));
|
||||
$this->assertTags($result, $expected);
|
||||
$this->assertNotRegExp('/<option[^<>]+value=""[^<>]+selected="selected"[^>]*>/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/<option[^<>]+value=""[^<>]+selected="selected"[^>]*>/', $result);
|
||||
|
||||
$result = $this->Form->dateTime('Contact.date', 'DMY', '12', array('interval' => 5, 'value' => ''));
|
||||
$expected = array(
|
||||
|
@ -7033,7 +7033,7 @@ class FormHelperTest extends CakeTestCase {
|
|||
'*/select'
|
||||
);
|
||||
$this->assertTags($result, $expected);
|
||||
$this->assertNotRegExp('/<option[^<>]+value=""[^<>]+selected="selected"[^>]*>/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/<option[^<>]+value=""[^<>]+selected="selected"[^>]*>/', $result);
|
||||
|
||||
$result = $this->Form->dateTime('Contact.date', 'DMY', '12', array('minuteInterval' => 5, 'value' => ''));
|
||||
$result = $this->Form->dateTime('Contact.date', 'DMY', '12', array('minuteInterval' => 5, 'value' => ''));
|
||||
|
@ -7077,7 +7077,7 @@ class FormHelperTest extends CakeTestCase {
|
|||
'*/select'
|
||||
);
|
||||
$this->assertTags($result, $expected);
|
||||
$this->assertNotRegExp('/<option[^<>]+value=""[^<>]+selected="selected"[^>]*>/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/<option[^<>]+value=""[^<>]+selected="selected"[^>]*>/', $result);
|
||||
|
||||
$this->Form->request->data['Model']['field'] = date('Y') . '-01-01 00:00:00';
|
||||
$now = strtotime($this->Form->data['Model']['field']);
|
||||
|
@ -7316,7 +7316,7 @@ class FormHelperTest extends CakeTestCase {
|
|||
*/
|
||||
public function testDateTimeWithBogusData() {
|
||||
$result = $this->Form->dateTime('Contact.updated', 'DMY', '12', array('value' => 'CURRENT_TIMESTAMP'));
|
||||
$this->assertNotRegExp('/selected="selected">\d/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/selected="selected">\d/', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -7335,7 +7335,7 @@ class FormHelperTest extends CakeTestCase {
|
|||
);
|
||||
|
||||
$this->assertMatchesRegularExpression('/<option value="">-<\/option>/', $result);
|
||||
$this->assertNotRegExp('/<option value="0" selected="selected">0<\/option>/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/<option value="0" selected="selected">0<\/option>/', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -7359,7 +7359,7 @@ class FormHelperTest extends CakeTestCase {
|
|||
$this->assertMatchesRegularExpression('/<option value="">YEAR<\/option>/', $result);
|
||||
$this->assertMatchesRegularExpression('/<option value="">HOUR<\/option>/', $result);
|
||||
$this->assertMatchesRegularExpression('/<option value="">MINUTE<\/option>/', $result);
|
||||
$this->assertNotRegExp('/<option value=""><\/option>/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/<option value=""><\/option>/', $result);
|
||||
|
||||
$result = $this->Form->dateTime('Contact.date',
|
||||
'DMY',
|
||||
|
@ -8506,7 +8506,7 @@ class FormHelperTest extends CakeTestCase {
|
|||
$this->assertTags($result, array('button' => array(), 'No type', '/button'));
|
||||
|
||||
$result = $this->Form->button('Upload Text', array('onClick' => "$('#postAddForm').ajaxSubmit({target: '#postTextUpload', url: '/posts/text'});return false;'", 'escape' => false));
|
||||
$this->assertNotRegExp('/\&039/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/\&039/', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -9722,7 +9722,7 @@ class FormHelperTest extends CakeTestCase {
|
|||
$this->assertTags($result, array('input' => array(
|
||||
'name' => 'password', 'type' => 'password', 'id' => 'ContactPassword'
|
||||
)));
|
||||
$this->assertNotRegExp('/<input[^<>]+[^id|name|type|value]=[^<>]*>$/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/<input[^<>]+[^id|name|type|value]=[^<>]*>$/', $result);
|
||||
|
||||
$result = $this->Form->text('user_form');
|
||||
$this->assertTags($result, array('input' => array(
|
||||
|
|
|
@ -1088,7 +1088,7 @@ class HtmlHelperTest extends CakeTestCase {
|
|||
$this->assertNull($result, 'Script returned upon duplicate inclusion %s');
|
||||
|
||||
$result = $this->Html->script(array('foo', 'bar', 'baz'));
|
||||
$this->assertNotRegExp('/foo.js/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/foo.js/', $result);
|
||||
|
||||
$result = $this->Html->script('foo', array('inline' => true, 'once' => false));
|
||||
$this->assertNotNull($result);
|
||||
|
@ -1152,7 +1152,7 @@ class HtmlHelperTest extends CakeTestCase {
|
|||
$this->assertNull($result, 'Script returned upon duplicate inclusion %s');
|
||||
|
||||
$result = $this->Html->script(array('TestPlugin.foo', 'TestPlugin.bar', 'TestPlugin.baz'));
|
||||
$this->assertNotRegExp('/test_plugin\/js\/foo.js/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/test_plugin\/js\/foo.js/', $result);
|
||||
|
||||
$result = $this->Html->script('TestPlugin.foo', array('inline' => true, 'once' => false));
|
||||
$this->assertNotNull($result);
|
||||
|
|
|
@ -904,8 +904,8 @@ class JsBaseEngineTest extends CakeTestCase {
|
|||
$result = $this->JsEngine->object($object, array('prefix' => 'PREFIX', 'postfix' => 'POSTFIX'));
|
||||
$this->assertMatchesRegularExpression('/^PREFIX/', $result);
|
||||
$this->assertMatchesRegularExpression('/POSTFIX$/', $result);
|
||||
$this->assertNotRegExp('/.PREFIX./', $result);
|
||||
$this->assertNotRegExp('/.POSTFIX./', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/.PREFIX./', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/.POSTFIX./', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -839,10 +839,10 @@ class HelperTest extends CakeTestCase {
|
|||
$this->assertEquals('with something', $result);
|
||||
|
||||
$result = $this->Helper->clean('<script type="text/javascript">alert("ruined");</script>');
|
||||
$this->assertNotRegExp('#</*script#', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('#</*script#', $result);
|
||||
|
||||
$result = $this->Helper->clean("<script \ntype=\"text/javascript\">\n\talert('ruined');\n\n\t\t</script>");
|
||||
$this->assertNotRegExp('#</*script#', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('#</*script#', $result);
|
||||
|
||||
$result = $this->Helper->clean('<body/onload=do(/something/)>');
|
||||
$this->assertEquals('<body/>', $result);
|
||||
|
|
|
@ -286,7 +286,7 @@ class ScaffoldViewTest extends CakeTestCase {
|
|||
//check related table
|
||||
$this->assertMatchesRegularExpression('/<div class="related">\s*<h3>Related Scaffold Comments<\/h3>\s*<table cellpadding="0" cellspacing="0">/', $result);
|
||||
$this->assertMatchesRegularExpression('/<li><a href="\/scaffold_comments\/add">New Comment<\/a><\/li>/', $result);
|
||||
$this->assertNotRegExp('/<th>JoinThing<\/th>/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/<th>JoinThing<\/th>/', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1282,7 +1282,7 @@ class ViewTest extends CakeTestCase {
|
|||
$View->helpers = array('Html', 'Form', 'Cache');
|
||||
$View->layout = 'cache_layout';
|
||||
$result = $View->render('index');
|
||||
$this->assertNotRegExp('/cake:nocache/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/cake:nocache/', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1297,7 +1297,7 @@ class ViewTest extends CakeTestCase {
|
|||
$View->helpers = array('Html', 'Form');
|
||||
$View->layout = 'cache_layout';
|
||||
$result = $View->render('index');
|
||||
$this->assertNotRegExp('/cake:nocache/', $result);
|
||||
$this->assertDoesNotMatchRegularExpression('/cake:nocache/', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue