mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
test: Replace assertContains() with assertStringContainsString() for text assertion.
assertContains() can no longer be used for text containment assertion.
This commit is contained in:
parent
6529d5a308
commit
dfc1c56625
34 changed files with 418 additions and 418 deletions
|
@ -122,12 +122,12 @@ class CommandListShellTest extends CakeTestCase {
|
|||
$output = $this->Shell->stdout->output;
|
||||
|
||||
$find = '<shell name="sample" call_as="sample" provider="app" help="sample -h"/>';
|
||||
$this->assertContains($find, $output);
|
||||
$this->assertStringContainsString($find, $output);
|
||||
|
||||
$find = '<shell name="bake" call_as="bake" provider="CORE" help="bake -h"/>';
|
||||
$this->assertContains($find, $output);
|
||||
$this->assertStringContainsString($find, $output);
|
||||
|
||||
$find = '<shell name="welcome" call_as="TestPluginTwo.welcome" provider="TestPluginTwo" help="TestPluginTwo.welcome -h"/>';
|
||||
$this->assertContains($find, $output);
|
||||
$this->assertStringContainsString($find, $output);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -421,7 +421,7 @@ class SchemaShellTest extends CakeTestCase {
|
|||
|
||||
$this->assertNotContains('public $acos = array(', $contents);
|
||||
$this->assertNotContains('public $aros = array(', $contents);
|
||||
$this->assertContains('public $aros_acos = array(', $contents);
|
||||
$this->assertStringContainsString('public $aros_acos = array(', $contents);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -320,7 +320,7 @@ class ControllerTaskTest extends CakeTestCase {
|
|||
$path = APP . 'Plugin' . DS . 'ControllerTest' . DS . 'Controller' . DS . 'ArticlesController.php';
|
||||
$result = $this->Task->bake('Articles', '--actions--', array(), array(), array());
|
||||
|
||||
$this->assertContains("App::uses('ControllerTestAppController', 'ControllerTest.Controller');", $result);
|
||||
$this->assertStringContainsString("App::uses('ControllerTestAppController', 'ControllerTest.Controller');", $result);
|
||||
$this->assertEquals('ControllerTest', $this->Task->Template->templateVars['plugin']);
|
||||
$this->assertEquals('ControllerTest.', $this->Task->Template->templateVars['pluginPath']);
|
||||
|
||||
|
@ -338,11 +338,11 @@ class ControllerTaskTest extends CakeTestCase {
|
|||
$this->assertTextEquals($expected, $result);
|
||||
|
||||
$result = $this->Task->bakeActions('BakeArticles', 'admin_', true);
|
||||
$this->assertContains('function admin_index() {', $result);
|
||||
$this->assertContains('function admin_add()', $result);
|
||||
$this->assertContains('function admin_view($id = null)', $result);
|
||||
$this->assertContains('function admin_edit($id = null)', $result);
|
||||
$this->assertContains('function admin_delete($id = null)', $result);
|
||||
$this->assertStringContainsString('function admin_index() {', $result);
|
||||
$this->assertStringContainsString('function admin_add()', $result);
|
||||
$this->assertStringContainsString('function admin_view($id = null)', $result);
|
||||
$this->assertStringContainsString('function admin_edit($id = null)', $result);
|
||||
$this->assertStringContainsString('function admin_delete($id = null)', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -159,8 +159,8 @@ class ExtractTaskTest extends CakeTestCase {
|
|||
$pattern .= '"\nmsgstr ""/';
|
||||
$this->assertMatchesRegularExpression($pattern, $result);
|
||||
|
||||
$this->assertContains('msgid "double \\"quoted\\""', $result, 'Strings with quotes not handled correctly');
|
||||
$this->assertContains("msgid \"single 'quoted'\"", $result, 'Strings with quotes not handled correctly');
|
||||
$this->assertStringContainsString('msgid "double \\"quoted\\""', $result, 'Strings with quotes not handled correctly');
|
||||
$this->assertStringContainsString("msgid \"single 'quoted'\"", $result, 'Strings with quotes not handled correctly');
|
||||
|
||||
$pattern = '/\#: extract\.ctp:36\nmsgid "letter"/';
|
||||
$this->assertMatchesRegularExpression($pattern, $result, 'Strings with context should not overwrite strings without context');
|
||||
|
@ -349,9 +349,9 @@ class ExtractTaskTest extends CakeTestCase {
|
|||
$this->Task->execute();
|
||||
$result = file_get_contents($this->path . DS . 'default.pot');
|
||||
$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);
|
||||
$this->assertStringContainsString('translate.ctp:1', $result);
|
||||
$this->assertStringContainsString('This is a translatable string', $result);
|
||||
$this->assertStringContainsString('I can haz plugin model validation message', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -380,14 +380,14 @@ class ExtractTaskTest extends CakeTestCase {
|
|||
|
||||
$this->Task->execute();
|
||||
$result = file_get_contents($this->path . DS . 'default.pot');
|
||||
$this->assertContains('Model/PersisterOne.php:validation for field title', $result);
|
||||
$this->assertContains('Model/PersisterOne.php:validation for field body', $result);
|
||||
$this->assertContains('msgid "Post title is required"', $result);
|
||||
$this->assertContains('msgid "You may enter up to %s chars (minimum is %s chars)"', $result);
|
||||
$this->assertContains('msgid "Post body is required"', $result);
|
||||
$this->assertContains('msgid "Post body is super required"', $result);
|
||||
$this->assertContains('msgid "double \\"quoted\\" validation"', $result, 'Strings with quotes not handled correctly');
|
||||
$this->assertContains("msgid \"single 'quoted' validation\"", $result, 'Strings with quotes not handled correctly');
|
||||
$this->assertStringContainsString('Model/PersisterOne.php:validation for field title', $result);
|
||||
$this->assertStringContainsString('Model/PersisterOne.php:validation for field body', $result);
|
||||
$this->assertStringContainsString('msgid "Post title is required"', $result);
|
||||
$this->assertStringContainsString('msgid "You may enter up to %s chars (minimum is %s chars)"', $result);
|
||||
$this->assertStringContainsString('msgid "Post body is required"', $result);
|
||||
$this->assertStringContainsString('msgid "Post body is super required"', $result);
|
||||
$this->assertStringContainsString('msgid "double \\"quoted\\" validation"', $result, 'Strings with quotes not handled correctly');
|
||||
$this->assertStringContainsString("msgid \"single 'quoted' validation\"", $result, 'Strings with quotes not handled correctly');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -416,11 +416,11 @@ class ExtractTaskTest extends CakeTestCase {
|
|||
|
||||
$this->Task->execute();
|
||||
$result = file_get_contents($this->path . DS . 'test_plugin.pot');
|
||||
$this->assertContains('Plugin/TestPlugin/Model/TestPluginPost.php:validation for field title', $result);
|
||||
$this->assertContains('Plugin/TestPlugin/Model/TestPluginPost.php:validation for field body', $result);
|
||||
$this->assertContains('msgid "Post title is required"', $result);
|
||||
$this->assertContains('msgid "Post body is required"', $result);
|
||||
$this->assertContains('msgid "Post body is super required"', $result);
|
||||
$this->assertStringContainsString('Plugin/TestPlugin/Model/TestPluginPost.php:validation for field title', $result);
|
||||
$this->assertStringContainsString('Plugin/TestPlugin/Model/TestPluginPost.php:validation for field body', $result);
|
||||
$this->assertStringContainsString('msgid "Post title is required"', $result);
|
||||
$this->assertStringContainsString('msgid "Post body is required"', $result);
|
||||
$this->assertStringContainsString('msgid "Post body is super required"', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -445,11 +445,11 @@ class ExtractTaskTest extends CakeTestCase {
|
|||
|
||||
$this->Task->execute();
|
||||
$result = file_get_contents($this->path . DS . 'test_plugin.pot');
|
||||
$this->assertContains('Model/TestPluginPost.php:validation for field title', $result);
|
||||
$this->assertContains('Model/TestPluginPost.php:validation for field body', $result);
|
||||
$this->assertContains('msgid "Post title is required"', $result);
|
||||
$this->assertContains('msgid "Post body is required"', $result);
|
||||
$this->assertContains('msgid "Post body is super required"', $result);
|
||||
$this->assertStringContainsString('Model/TestPluginPost.php:validation for field title', $result);
|
||||
$this->assertStringContainsString('Model/TestPluginPost.php:validation for field body', $result);
|
||||
$this->assertStringContainsString('msgid "Post title is required"', $result);
|
||||
$this->assertStringContainsString('msgid "Post body is required"', $result);
|
||||
$this->assertStringContainsString('msgid "Post body is super required"', $result);
|
||||
$this->assertNotContains('Plugin/TestPlugin/Model/TestPluginPost.php:validation for field title', $result);
|
||||
}
|
||||
|
||||
|
|
|
@ -215,11 +215,11 @@ class FixtureTaskTest extends CakeTestCase {
|
|||
'fromTable' => true, 'schema' => 'Article', 'records' => false
|
||||
));
|
||||
|
||||
$this->assertContains('class ArticleFixture extends CakeTestFixture', $result);
|
||||
$this->assertContains('public $records', $result);
|
||||
$this->assertContains('public $import', $result);
|
||||
$this->assertContains("'title' => 'First Article'", $result, 'Missing import data');
|
||||
$this->assertContains('Second Article', $result, 'Missing import data');
|
||||
$this->assertStringContainsString('class ArticleFixture extends CakeTestFixture', $result);
|
||||
$this->assertStringContainsString('public $records', $result);
|
||||
$this->assertStringContainsString('public $import', $result);
|
||||
$this->assertStringContainsString("'title' => 'First Article'", $result, 'Missing import data');
|
||||
$this->assertStringContainsString('Second Article', $result, 'Missing import data');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -230,7 +230,7 @@ class FixtureTaskTest extends CakeTestCase {
|
|||
public function testImportOptionsAlternateConnection() {
|
||||
$this->Task->connection = 'test';
|
||||
$result = $this->Task->bake('Article', false, array('schema' => 'Article'));
|
||||
$this->assertContains("'connection' => 'test'", $result);
|
||||
$this->assertStringContainsString("'connection' => 'test'", $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -259,7 +259,7 @@ class FixtureTaskTest extends CakeTestCase {
|
|||
'schema' => 'Article',
|
||||
'records' => false
|
||||
));
|
||||
$this->assertContains("'body' => 'Body \"value\"'", $result, 'Data has bad escaping');
|
||||
$this->assertStringContainsString("'body' => 'Body \"value\"'", $result, 'Data has bad escaping');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -445,26 +445,26 @@ class FixtureTaskTest extends CakeTestCase {
|
|||
$this->Task->path = '/my/path/';
|
||||
|
||||
$result = $this->Task->bake('Article');
|
||||
$this->assertContains('class ArticleFixture extends CakeTestFixture', $result);
|
||||
$this->assertContains('public $fields', $result);
|
||||
$this->assertContains('public $records', $result);
|
||||
$this->assertStringContainsString('class ArticleFixture extends CakeTestFixture', $result);
|
||||
$this->assertStringContainsString('public $fields', $result);
|
||||
$this->assertStringContainsString('public $records', $result);
|
||||
$this->assertNotContains('public $import', $result);
|
||||
|
||||
$result = $this->Task->bake('Article', 'comments');
|
||||
$this->assertContains('class ArticleFixture extends CakeTestFixture', $result);
|
||||
$this->assertContains('public $table = \'comments\';', $result);
|
||||
$this->assertContains('public $fields = array(', $result);
|
||||
$this->assertStringContainsString('class ArticleFixture extends CakeTestFixture', $result);
|
||||
$this->assertStringContainsString('public $table = \'comments\';', $result);
|
||||
$this->assertStringContainsString('public $fields = array(', $result);
|
||||
|
||||
$result = $this->Task->bake('Article', 'comments', array('records' => true));
|
||||
$this->assertContains("public \$import = array('records' => true, 'connection' => 'test');", $result);
|
||||
$this->assertStringContainsString("public \$import = array('records' => true, 'connection' => 'test');", $result);
|
||||
$this->assertNotContains('public $records', $result);
|
||||
|
||||
$result = $this->Task->bake('Article', 'comments', array('schema' => 'Article'));
|
||||
$this->assertContains("public \$import = array('model' => 'Article', 'connection' => 'test');", $result);
|
||||
$this->assertStringContainsString("public \$import = array('model' => 'Article', 'connection' => 'test');", $result);
|
||||
$this->assertNotContains('public $fields', $result);
|
||||
|
||||
$result = $this->Task->bake('Article', 'comments', array('schema' => 'Article', 'records' => true));
|
||||
$this->assertContains("public \$import = array('model' => 'Article', 'records' => true, 'connection' => 'test');", $result);
|
||||
$this->assertStringContainsString("public \$import = array('model' => 'Article', 'records' => true, 'connection' => 'test');", $result);
|
||||
$this->assertNotContains('public $fields', $result);
|
||||
$this->assertNotContains('public $records', $result);
|
||||
}
|
||||
|
@ -479,14 +479,14 @@ class FixtureTaskTest extends CakeTestCase {
|
|||
$this->Task->path = '/my/path/';
|
||||
|
||||
$result = $this->Task->bake('Article', 'datatypes');
|
||||
$this->assertContains("'float_field' => 1", $result);
|
||||
$this->assertContains("'bool' => 1", $result);
|
||||
$this->assertContains("'tiny_int' => 1", $result);
|
||||
$this->assertContains("'small_int' => 1", $result);
|
||||
$this->assertContains("'huge_int' => 1", $result);
|
||||
$this->assertStringContainsString("'float_field' => 1", $result);
|
||||
$this->assertStringContainsString("'bool' => 1", $result);
|
||||
$this->assertStringContainsString("'tiny_int' => 1", $result);
|
||||
$this->assertStringContainsString("'small_int' => 1", $result);
|
||||
$this->assertStringContainsString("'huge_int' => 1", $result);
|
||||
|
||||
$result = $this->Task->bake('Article', 'binary_tests');
|
||||
$this->assertContains("'data' => 'Lorem ipsum dolor sit amet'", $result);
|
||||
$this->assertStringContainsString("'data' => 'Lorem ipsum dolor sit amet'", $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -911,10 +911,10 @@ STRINGEND;
|
|||
)
|
||||
);
|
||||
$result = $this->Task->bake('BakeArticle', compact('associations'));
|
||||
$this->assertContains(' * @property BakeUser $BakeUser', $result);
|
||||
$this->assertContains(' * @property OtherModel $OtherModel', $result);
|
||||
$this->assertContains(' * @property BakeComment $BakeComment', $result);
|
||||
$this->assertContains(' * @property BakeTag $BakeTag', $result);
|
||||
$this->assertStringContainsString(' * @property BakeUser $BakeUser', $result);
|
||||
$this->assertStringContainsString(' * @property OtherModel $OtherModel', $result);
|
||||
$this->assertStringContainsString(' * @property BakeComment $BakeComment', $result);
|
||||
$this->assertStringContainsString(' * @property BakeTag $BakeTag', $result);
|
||||
$this->assertMatchesRegularExpression('/\$hasAndBelongsToMany \= array\(/', $result);
|
||||
$this->assertMatchesRegularExpression('/\$hasMany \= array\(/', $result);
|
||||
$this->assertMatchesRegularExpression('/\$belongsTo \= array\(/', $result);
|
||||
|
@ -940,7 +940,7 @@ STRINGEND;
|
|||
->with($path, $this->stringContains('BakeArticle extends ControllerTestAppModel'));
|
||||
|
||||
$result = $this->Task->bake('BakeArticle', array(), array());
|
||||
$this->assertContains("App::uses('ControllerTestAppModel', 'ControllerTest.Model');", $result);
|
||||
$this->assertStringContainsString("App::uses('ControllerTestAppModel', 'ControllerTest.Model');", $result);
|
||||
|
||||
$this->assertEquals(count(ClassRegistry::keys()), 0);
|
||||
$this->assertEquals(count(ClassRegistry::mapKeys()), 0);
|
||||
|
|
|
@ -402,24 +402,24 @@ class TestTaskTest extends CakeTestCase {
|
|||
|
||||
$result = $this->Task->bake('Model', 'TestTaskArticle');
|
||||
|
||||
$this->assertContains("App::uses('TestTaskArticle', 'Model')", $result);
|
||||
$this->assertContains('class TestTaskArticleTest extends CakeTestCase', $result);
|
||||
$this->assertStringContainsString("App::uses('TestTaskArticle', 'Model')", $result);
|
||||
$this->assertStringContainsString('class TestTaskArticleTest extends CakeTestCase', $result);
|
||||
|
||||
$this->assertContains('function setUp()', $result);
|
||||
$this->assertContains("\$this->TestTaskArticle = ClassRegistry::init('TestTaskArticle')", $result);
|
||||
$this->assertStringContainsString('function setUp()', $result);
|
||||
$this->assertStringContainsString("\$this->TestTaskArticle = ClassRegistry::init('TestTaskArticle')", $result);
|
||||
|
||||
$this->assertContains('function tearDown()', $result);
|
||||
$this->assertContains('unset($this->TestTaskArticle)', $result);
|
||||
$this->assertStringContainsString('function tearDown()', $result);
|
||||
$this->assertStringContainsString('unset($this->TestTaskArticle)', $result);
|
||||
|
||||
$this->assertContains('function testDoSomething()', $result);
|
||||
$this->assertContains('function testDoSomethingElse()', $result);
|
||||
$this->assertContains('$this->markTestIncomplete(\'testDoSomething not implemented.\')', $result);
|
||||
$this->assertContains('$this->markTestIncomplete(\'testDoSomethingElse not implemented.\')', $result);
|
||||
$this->assertStringContainsString('function testDoSomething()', $result);
|
||||
$this->assertStringContainsString('function testDoSomethingElse()', $result);
|
||||
$this->assertStringContainsString('$this->markTestIncomplete(\'testDoSomething not implemented.\')', $result);
|
||||
$this->assertStringContainsString('$this->markTestIncomplete(\'testDoSomethingElse not implemented.\')', $result);
|
||||
|
||||
$this->assertContains("'app.test_task_article'", $result);
|
||||
$this->assertContains("'app.test_task_comment'", $result);
|
||||
$this->assertContains("'app.test_task_tag'", $result);
|
||||
$this->assertContains("'app.articles_tag'", $result);
|
||||
$this->assertStringContainsString("'app.test_task_article'", $result);
|
||||
$this->assertStringContainsString("'app.test_task_comment'", $result);
|
||||
$this->assertStringContainsString("'app.test_task_tag'", $result);
|
||||
$this->assertStringContainsString("'app.articles_tag'", $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -433,8 +433,8 @@ class TestTaskTest extends CakeTestCase {
|
|||
|
||||
$result = $this->Task->bake('Controller', 'TestTaskComments');
|
||||
|
||||
$this->assertContains("App::uses('TestTaskCommentsController', 'Controller')", $result);
|
||||
$this->assertContains('class TestTaskCommentsControllerTest extends ControllerTestCase', $result);
|
||||
$this->assertStringContainsString("App::uses('TestTaskCommentsController', 'Controller')", $result);
|
||||
$this->assertStringContainsString('class TestTaskCommentsControllerTest extends ControllerTestCase', $result);
|
||||
|
||||
$this->assertNotContains('function setUp()', $result);
|
||||
$this->assertNotContains("\$this->TestTaskComments = new TestTaskCommentsController()", $result);
|
||||
|
@ -443,10 +443,10 @@ class TestTaskTest extends CakeTestCase {
|
|||
$this->assertNotContains('function tearDown()', $result);
|
||||
$this->assertNotContains('unset($this->TestTaskComments)', $result);
|
||||
|
||||
$this->assertContains("'app.test_task_article'", $result);
|
||||
$this->assertContains("'app.test_task_comment'", $result);
|
||||
$this->assertContains("'app.test_task_tag'", $result);
|
||||
$this->assertContains("'app.articles_tag'", $result);
|
||||
$this->assertStringContainsString("'app.test_task_article'", $result);
|
||||
$this->assertStringContainsString("'app.test_task_comment'", $result);
|
||||
$this->assertStringContainsString("'app.test_task_tag'", $result);
|
||||
$this->assertStringContainsString("'app.articles_tag'", $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -459,17 +459,17 @@ class TestTaskTest extends CakeTestCase {
|
|||
|
||||
$result = $this->Task->bake('Component', 'Example');
|
||||
|
||||
$this->assertContains("App::uses('Component', 'Controller')", $result);
|
||||
$this->assertContains("App::uses('ComponentCollection', 'Controller')", $result);
|
||||
$this->assertContains("App::uses('ExampleComponent', 'Controller/Component')", $result);
|
||||
$this->assertContains('class ExampleComponentTest extends CakeTestCase', $result);
|
||||
$this->assertStringContainsString("App::uses('Component', 'Controller')", $result);
|
||||
$this->assertStringContainsString("App::uses('ComponentCollection', 'Controller')", $result);
|
||||
$this->assertStringContainsString("App::uses('ExampleComponent', 'Controller/Component')", $result);
|
||||
$this->assertStringContainsString('class ExampleComponentTest extends CakeTestCase', $result);
|
||||
|
||||
$this->assertContains('function setUp()', $result);
|
||||
$this->assertContains("\$Collection = new ComponentCollection()", $result);
|
||||
$this->assertContains("\$this->Example = new ExampleComponent(\$Collection)", $result);
|
||||
$this->assertStringContainsString('function setUp()', $result);
|
||||
$this->assertStringContainsString("\$Collection = new ComponentCollection()", $result);
|
||||
$this->assertStringContainsString("\$this->Example = new ExampleComponent(\$Collection)", $result);
|
||||
|
||||
$this->assertContains('function tearDown()', $result);
|
||||
$this->assertContains('unset($this->Example)', $result);
|
||||
$this->assertStringContainsString('function tearDown()', $result);
|
||||
$this->assertStringContainsString('unset($this->Example)', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -482,14 +482,14 @@ class TestTaskTest extends CakeTestCase {
|
|||
|
||||
$result = $this->Task->bake('Behavior', 'Example');
|
||||
|
||||
$this->assertContains("App::uses('ExampleBehavior', 'Model/Behavior')", $result);
|
||||
$this->assertContains('class ExampleBehaviorTest extends CakeTestCase', $result);
|
||||
$this->assertStringContainsString("App::uses('ExampleBehavior', 'Model/Behavior')", $result);
|
||||
$this->assertStringContainsString('class ExampleBehaviorTest extends CakeTestCase', $result);
|
||||
|
||||
$this->assertContains('function setUp()', $result);
|
||||
$this->assertContains("\$this->Example = new ExampleBehavior()", $result);
|
||||
$this->assertStringContainsString('function setUp()', $result);
|
||||
$this->assertStringContainsString("\$this->Example = new ExampleBehavior()", $result);
|
||||
|
||||
$this->assertContains('function tearDown()', $result);
|
||||
$this->assertContains('unset($this->Example)', $result);
|
||||
$this->assertStringContainsString('function tearDown()', $result);
|
||||
$this->assertStringContainsString('unset($this->Example)', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -502,15 +502,15 @@ class TestTaskTest extends CakeTestCase {
|
|||
|
||||
$result = $this->Task->bake('Helper', 'Example');
|
||||
|
||||
$this->assertContains("App::uses('ExampleHelper', 'View/Helper')", $result);
|
||||
$this->assertContains('class ExampleHelperTest extends CakeTestCase', $result);
|
||||
$this->assertStringContainsString("App::uses('ExampleHelper', 'View/Helper')", $result);
|
||||
$this->assertStringContainsString('class ExampleHelperTest extends CakeTestCase', $result);
|
||||
|
||||
$this->assertContains('function setUp()', $result);
|
||||
$this->assertContains("\$View = new View()", $result);
|
||||
$this->assertContains("\$this->Example = new ExampleHelper(\$View)", $result);
|
||||
$this->assertStringContainsString('function setUp()', $result);
|
||||
$this->assertStringContainsString("\$View = new View()", $result);
|
||||
$this->assertStringContainsString("\$this->Example = new ExampleHelper(\$View)", $result);
|
||||
|
||||
$this->assertContains('function tearDown()', $result);
|
||||
$this->assertContains('unset($this->Example)', $result);
|
||||
$this->assertStringContainsString('function tearDown()', $result);
|
||||
$this->assertStringContainsString('unset($this->Example)', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -252,7 +252,7 @@ TEXT;
|
|||
$formatter = new HelpFormatter($parser);
|
||||
$result = $formatter->text();
|
||||
$expected = 'cake mycommand [options] <model> [<other_longer>]';
|
||||
$this->assertContains($expected, $result);
|
||||
$this->assertStringContainsString($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -276,7 +276,7 @@ TEXT;
|
|||
$formatter = new HelpFormatter($parser);
|
||||
$result = $formatter->text();
|
||||
$expected = 'cake mycommand [-h] [arguments]';
|
||||
$this->assertContains($expected, $result);
|
||||
$this->assertStringContainsString($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -965,7 +965,7 @@ TEXT;
|
|||
$this->Shell->log_something();
|
||||
$this->assertTrue(file_exists(LOGS . 'error.log'));
|
||||
$contents = file_get_contents(LOGS . 'error.log');
|
||||
$this->assertContains($this->Shell->testMessage, $contents);
|
||||
$this->assertStringContainsString($this->Shell->testMessage, $contents);
|
||||
|
||||
CakeLog::enable('stdout');
|
||||
CakeLog::enable('stderr');
|
||||
|
|
|
@ -79,7 +79,7 @@ class ApplicationControllerTest extends ControllerTestCase {
|
|||
public function testRedirect() {
|
||||
$sessionId = 'o7k64tlhil9pakp89j6d8ovlqk';
|
||||
$this->testAction('/trans_session_id/next?CAKEPHP=' . $sessionId);
|
||||
$this->assertContains('/trans_session_id/next_step?CAKEPHP=' . $sessionId, $this->headers['Location']);
|
||||
$this->assertStringContainsString('/trans_session_id/next_step?CAKEPHP=' . $sessionId, $this->headers['Location']);
|
||||
$expectedConfig = array(
|
||||
'cookie' => 'CAKEPHP',
|
||||
'timeout' => 240,
|
||||
|
|
|
@ -900,8 +900,8 @@ HTMLBLOC;
|
|||
$this->assertTrue($this->Controller->EmailTest->send('This is the body of the message'));
|
||||
$result = DebugCompTransport::$lastEmail;
|
||||
|
||||
$this->assertContains('From: =?UTF-8?B?VGXDn3Qg?= <test@example.com>', $result);
|
||||
$this->assertContains('To: =?UTF-8?B?VGXDn3Qg?= <test@example.com>', $result);
|
||||
$this->assertStringContainsString('From: =?UTF-8?B?VGXDn3Qg?= <test@example.com>', $result);
|
||||
$this->assertStringContainsString('To: =?UTF-8?B?VGXDn3Qg?= <test@example.com>', $result);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -503,8 +503,8 @@ class ConfigureTest extends CakeTestCase {
|
|||
$result = Configure::dump('config_test.php', 'test_reader');
|
||||
$this->assertTrue($result > 0);
|
||||
$result = file_get_contents(TMP . 'config_test.php');
|
||||
$this->assertContains('<?php', $result);
|
||||
$this->assertContains('$config = ', $result);
|
||||
$this->assertStringContainsString('<?php', $result);
|
||||
$this->assertStringContainsString('$config = ', $result);
|
||||
if (file_exists(TMP . 'config_test.php')) {
|
||||
unlink(TMP . 'config_test.php');
|
||||
}
|
||||
|
@ -521,9 +521,9 @@ class ConfigureTest extends CakeTestCase {
|
|||
$result = Configure::dump('config_test.php', 'test_reader', array('Error'));
|
||||
$this->assertTrue($result > 0);
|
||||
$result = file_get_contents(TMP . 'config_test.php');
|
||||
$this->assertContains('<?php', $result);
|
||||
$this->assertContains('$config = ', $result);
|
||||
$this->assertContains('Error', $result);
|
||||
$this->assertStringContainsString('<?php', $result);
|
||||
$this->assertStringContainsString('$config = ', $result);
|
||||
$this->assertStringContainsString('Error', $result);
|
||||
$this->assertNotContains('debug', $result);
|
||||
|
||||
if (file_exists(TMP . 'config_test.php')) {
|
||||
|
|
|
@ -240,8 +240,8 @@ class ErrorHandlerTest extends CakeTestCase {
|
|||
$this->assertMatchesRegularExpression('/Kaboom!/', $result, 'message missing.');
|
||||
|
||||
$log = file(LOGS . 'error.log');
|
||||
$this->assertContains('[NotFoundException] Kaboom!', $log[0], 'message missing.');
|
||||
$this->assertContains('ErrorHandlerTest->testHandleExceptionLog', $log[2], 'Stack trace missing.');
|
||||
$this->assertStringContainsString('[NotFoundException] Kaboom!', $log[0], 'message missing.');
|
||||
$this->assertStringContainsString('ErrorHandlerTest->testHandleExceptionLog', $log[2], 'Stack trace missing.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -270,7 +270,7 @@ class ErrorHandlerTest extends CakeTestCase {
|
|||
|
||||
$log = file(LOGS . 'error.log');
|
||||
$this->assertNotContains('[NotFoundException] Kaboom!', $log[0], 'message should not be logged.');
|
||||
$this->assertContains('[ForbiddenException] Fooled you!', $log[0], 'message missing.');
|
||||
$this->assertStringContainsString('[ForbiddenException] Fooled you!', $log[0], 'message missing.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -309,9 +309,9 @@ class ErrorHandlerTest extends CakeTestCase {
|
|||
Configure::write('debug', 1);
|
||||
ErrorHandler::handleFatalError(E_ERROR, 'Something wrong', __FILE__, $line);
|
||||
$result = ob_get_clean();
|
||||
$this->assertContains('Something wrong', $result, 'message missing.');
|
||||
$this->assertContains(__FILE__, $result, 'filename missing.');
|
||||
$this->assertContains((string)$line, $result, 'line missing.');
|
||||
$this->assertStringContainsString('Something wrong', $result, 'message missing.');
|
||||
$this->assertStringContainsString(__FILE__, $result, 'filename missing.');
|
||||
$this->assertStringContainsString((string)$line, $result, 'line missing.');
|
||||
|
||||
ob_start();
|
||||
ob_start();
|
||||
|
@ -320,7 +320,7 @@ class ErrorHandlerTest extends CakeTestCase {
|
|||
$result = ob_get_clean();
|
||||
$this->assertNotContains('Something wrong', $result, 'message must not appear.');
|
||||
$this->assertNotContains(__FILE__, $result, 'filename must not appear.');
|
||||
$this->assertContains('An Internal Error Has Occurred', $result);
|
||||
$this->assertStringContainsString('An Internal Error Has Occurred', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -338,8 +338,8 @@ class ErrorHandlerTest extends CakeTestCase {
|
|||
ob_clean();
|
||||
|
||||
$log = file(LOGS . 'error.log');
|
||||
$this->assertContains(__FILE__, $log[0], 'missing filename');
|
||||
$this->assertContains('[FatalErrorException] Something wrong', $log[1], 'message missing.');
|
||||
$this->assertStringContainsString(__FILE__, $log[0], 'missing filename');
|
||||
$this->assertStringContainsString('[FatalErrorException] Something wrong', $log[1], 'message missing.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -298,7 +298,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
ob_start();
|
||||
$renderer->render();
|
||||
$result = ob_get_clean();
|
||||
$this->assertContains('<b>peeled</b>', $result);
|
||||
$this->assertStringContainsString('<b>peeled</b>', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -318,7 +318,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
|
||||
$this->assertFalse(method_exists($ExceptionRenderer, 'missingWidgetThing'), 'no method should exist.');
|
||||
$this->assertEquals('error400', $ExceptionRenderer->method, 'incorrect method coercion.');
|
||||
$this->assertContains('coding fail', $result, 'Text should show up.');
|
||||
$this->assertStringContainsString('coding fail', $result, 'Text should show up.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -339,7 +339,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
$result = ob_get_clean();
|
||||
|
||||
$this->assertEquals('error500', $ExceptionRenderer->method, 'incorrect method coercion.');
|
||||
$this->assertContains('foul ball.', $result, 'Text should show up as its debug mode.');
|
||||
$this->assertStringContainsString('foul ball.', $result, 'Text should show up as its debug mode.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -363,7 +363,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
|
||||
$this->assertEquals('error500', $ExceptionRenderer->method, 'incorrect method coercion.');
|
||||
$this->assertNotContains('foul ball.', $result, 'Text should no show up.');
|
||||
$this->assertContains('Internal Error', $result, 'Generic message only.');
|
||||
$this->assertStringContainsString('Internal Error', $result, 'Generic message only.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -382,7 +382,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
$result = ob_get_clean();
|
||||
|
||||
$this->assertEquals('error500', $ExceptionRenderer->method, 'incorrect method coercion.');
|
||||
$this->assertContains('foul ball.', $result, 'Text should show up as its debug mode.');
|
||||
$this->assertStringContainsString('foul ball.', $result, 'Text should show up as its debug mode.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -423,7 +423,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
ob_start();
|
||||
$ExceptionRenderer->render();
|
||||
$result = ob_get_clean();
|
||||
$this->assertContains('Custom message', $result);
|
||||
$this->assertStringContainsString('Custom message', $result);
|
||||
|
||||
$exception = new MissingActionException(array('controller' => 'PostsController', 'action' => 'index'));
|
||||
$ExceptionRenderer = $this->_mockResponse(new ExceptionRenderer($exception));
|
||||
|
@ -431,7 +431,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
ob_start();
|
||||
$ExceptionRenderer->render();
|
||||
$result = ob_get_clean();
|
||||
$this->assertContains('Not Found', $result);
|
||||
$this->assertStringContainsString('Not Found', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -853,7 +853,7 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
$ExceptionRenderer->render();
|
||||
$result = ob_get_clean();
|
||||
|
||||
$this->assertContains('Internal Error', $result);
|
||||
$this->assertStringContainsString('Internal Error', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -873,10 +873,10 @@ class ExceptionRendererTest extends CakeTestCase {
|
|||
$ExceptionRenderer->render();
|
||||
$result = ob_get_clean();
|
||||
|
||||
$this->assertContains('<h2>Database Error</h2>', $result);
|
||||
$this->assertContains('There was an error in the SQL query', $result);
|
||||
$this->assertContains(h('SELECT * from poo_query < 5 and :seven'), $result);
|
||||
$this->assertContains("'seven' => (int) 7", $result);
|
||||
$this->assertStringContainsString('<h2>Database Error</h2>', $result);
|
||||
$this->assertStringContainsString('There was an error in the SQL query', $result);
|
||||
$this->assertStringContainsString(h('SELECT * from poo_query < 5 and :seven'), $result);
|
||||
$this->assertStringContainsString("'seven' => (int) 7", $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -241,9 +241,9 @@ class CakeLogTest extends CakeTestCase {
|
|||
$this->assertTrue(file_exists(LOGS . 'spam.log'));
|
||||
|
||||
$contents = file_get_contents(LOGS . 'spam.log');
|
||||
$this->assertContains('Debug: ' . $testMessage, $contents);
|
||||
$this->assertStringContainsString('Debug: ' . $testMessage, $contents);
|
||||
$contents = file_get_contents(LOGS . 'eggs.log');
|
||||
$this->assertContains('Debug: ' . $testMessage, $contents);
|
||||
$this->assertStringContainsString('Debug: ' . $testMessage, $contents);
|
||||
|
||||
if (file_exists(LOGS . 'spam.log')) {
|
||||
unlink(LOGS . 'spam.log');
|
||||
|
@ -621,21 +621,21 @@ class CakeLogTest extends CakeTestCase {
|
|||
$testMessage = 'critical message';
|
||||
CakeLog::critical($testMessage);
|
||||
$contents = file_get_contents(LOGS . 'error.log');
|
||||
$this->assertContains('Critical: ' . $testMessage, $contents);
|
||||
$this->assertStringContainsString('Critical: ' . $testMessage, $contents);
|
||||
$this->assertFalse(file_exists(LOGS . 'debug.log'));
|
||||
$this->_deleteLogs();
|
||||
|
||||
$testMessage = 'error message';
|
||||
CakeLog::error($testMessage);
|
||||
$contents = file_get_contents(LOGS . 'error.log');
|
||||
$this->assertContains('Error: ' . $testMessage, $contents);
|
||||
$this->assertStringContainsString('Error: ' . $testMessage, $contents);
|
||||
$this->assertFalse(file_exists(LOGS . 'debug.log'));
|
||||
$this->_deleteLogs();
|
||||
|
||||
$testMessage = 'warning message';
|
||||
CakeLog::warning($testMessage);
|
||||
$contents = file_get_contents(LOGS . 'error.log');
|
||||
$this->assertContains('Warning: ' . $testMessage, $contents);
|
||||
$this->assertStringContainsString('Warning: ' . $testMessage, $contents);
|
||||
$this->assertFalse(file_exists(LOGS . 'debug.log'));
|
||||
$this->_deleteLogs();
|
||||
|
||||
|
@ -656,7 +656,7 @@ class CakeLogTest extends CakeTestCase {
|
|||
$testMessage = 'debug message';
|
||||
CakeLog::debug($testMessage);
|
||||
$contents = file_get_contents(LOGS . 'debug.log');
|
||||
$this->assertContains('Debug: ' . $testMessage, $contents);
|
||||
$this->assertStringContainsString('Debug: ' . $testMessage, $contents);
|
||||
$this->assertFalse(file_exists(LOGS . 'error.log'));
|
||||
$this->_deleteLogs();
|
||||
}
|
||||
|
@ -709,7 +709,7 @@ class CakeLogTest extends CakeTestCase {
|
|||
CakeLog::defaultLevels();
|
||||
$this->assertTrue(file_exists(LOGS . 'error.log'));
|
||||
$contents = file_get_contents(LOGS . 'error.log');
|
||||
$this->assertContains('Error: ' . $testMessage, $contents);
|
||||
$this->assertStringContainsString('Error: ' . $testMessage, $contents);
|
||||
|
||||
CakeLog::config('spam', array(
|
||||
'engine' => 'File',
|
||||
|
@ -728,7 +728,7 @@ class CakeLogTest extends CakeTestCase {
|
|||
$this->assertTrue(file_exists(LOGS . 'spam.log'));
|
||||
$this->assertTrue(file_exists(LOGS . 'eggs.log'));
|
||||
$contents = file_get_contents(LOGS . 'spam.log');
|
||||
$this->assertContains('Spam: ' . $testMessage, $contents);
|
||||
$this->assertStringContainsString('Spam: ' . $testMessage, $contents);
|
||||
|
||||
$testMessage = 'egg message';
|
||||
CakeLog::write('eggs', $testMessage);
|
||||
|
@ -736,7 +736,7 @@ class CakeLogTest extends CakeTestCase {
|
|||
$contents = file_get_contents(LOGS . 'spam.log');
|
||||
$this->assertNotContains('Eggs: ' . $testMessage, $contents);
|
||||
$contents = file_get_contents(LOGS . 'eggs.log');
|
||||
$this->assertContains('Eggs: ' . $testMessage, $contents);
|
||||
$this->assertStringContainsString('Eggs: ' . $testMessage, $contents);
|
||||
|
||||
CakeLog::drop('spam');
|
||||
CakeLog::drop('eggs');
|
||||
|
|
|
@ -113,7 +113,7 @@ class ConsoleLogTest extends CakeTestCase {
|
|||
TestCakeLog::write(LOG_ERR, $message);
|
||||
$this->assertTrue(file_exists(LOGS . 'error.log'), 'error.log missing');
|
||||
$logOutput = file_get_contents(LOGS . 'error.log');
|
||||
$this->assertContains($message, $logOutput);
|
||||
$this->assertStringContainsString($message, $logOutput);
|
||||
|
||||
// TestConsoleLog is only interested in `error` type
|
||||
$message = 'Test info message';
|
||||
|
@ -127,7 +127,7 @@ class ConsoleLogTest extends CakeTestCase {
|
|||
$logOutput = file_get_contents(LOGS . 'error.log');
|
||||
$this->assertNotContains($message, $logOutput);
|
||||
$logOutput = file_get_contents(LOGS . 'debug.log');
|
||||
$this->assertContains($message, $logOutput);
|
||||
$this->assertStringContainsString($message, $logOutput);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -166,7 +166,7 @@ class MysqlTest extends CakeTestCase {
|
|||
$this->assertEquals('1234567.11', $result);
|
||||
|
||||
$result = $this->db->value(123456.45464748, 'float');
|
||||
$this->assertContains('123456.454647', $result);
|
||||
$this->assertStringContainsString('123456.454647', $result);
|
||||
|
||||
$result = $this->db->value(0.987654321, 'float');
|
||||
$this->assertEquals('0.987654321', (string)$result);
|
||||
|
@ -552,10 +552,10 @@ class MysqlTest extends CakeTestCase {
|
|||
'group2' => array('type' => 'integer', 'null' => true)
|
||||
)));
|
||||
$result = $this->Dbo->createSchema($schemaA);
|
||||
$this->assertContains('`id` int(11) DEFAULT 0 NOT NULL,', $result);
|
||||
$this->assertContains('`name` varchar(50) NOT NULL,', $result);
|
||||
$this->assertContains('`group1` int(11) DEFAULT NULL', $result);
|
||||
$this->assertContains('`group2` int(11) DEFAULT NULL', $result);
|
||||
$this->assertStringContainsString('`id` int(11) DEFAULT 0 NOT NULL,', $result);
|
||||
$this->assertStringContainsString('`name` varchar(50) NOT NULL,', $result);
|
||||
$this->assertStringContainsString('`group1` int(11) DEFAULT NULL', $result);
|
||||
$this->assertStringContainsString('`group2` int(11) DEFAULT NULL', $result);
|
||||
|
||||
//Test that the string is syntactically correct
|
||||
$query = $this->Dbo->getConnection()->prepare($result);
|
||||
|
@ -577,11 +577,11 @@ class MysqlTest extends CakeTestCase {
|
|||
)));
|
||||
|
||||
$result = $this->Dbo->alterSchema($schemaB->compare($schemaA));
|
||||
$this->assertContains("ALTER TABLE $table", $result);
|
||||
$this->assertContains('ADD KEY `name_idx` (`name`),', $result);
|
||||
$this->assertContains('ADD KEY `group_idx` (`group1`),', $result);
|
||||
$this->assertContains('ADD KEY `compound_idx` (`group1`, `group2`),', $result);
|
||||
$this->assertContains('ADD PRIMARY KEY (`id`);', $result);
|
||||
$this->assertStringContainsString("ALTER TABLE $table", $result);
|
||||
$this->assertStringContainsString('ADD KEY `name_idx` (`name`),', $result);
|
||||
$this->assertStringContainsString('ADD KEY `group_idx` (`group1`),', $result);
|
||||
$this->assertStringContainsString('ADD KEY `compound_idx` (`group1`, `group2`),', $result);
|
||||
$this->assertStringContainsString('ADD PRIMARY KEY (`id`);', $result);
|
||||
|
||||
//Test that the string is syntactically correct
|
||||
$query = $this->Dbo->getConnection()->prepare($result);
|
||||
|
@ -604,15 +604,15 @@ class MysqlTest extends CakeTestCase {
|
|||
)));
|
||||
|
||||
$result = $this->Dbo->alterSchema($schemaC->compare($schemaB));
|
||||
$this->assertContains("ALTER TABLE $table", $result);
|
||||
$this->assertContains('DROP PRIMARY KEY,', $result);
|
||||
$this->assertContains('DROP KEY `name_idx`,', $result);
|
||||
$this->assertContains('DROP KEY `group_idx`,', $result);
|
||||
$this->assertContains('DROP KEY `compound_idx`,', $result);
|
||||
$this->assertContains('ADD KEY `id_name_idx` (`id`, `name`),', $result);
|
||||
$this->assertContains('ADD UNIQUE KEY `name_idx` (`name`),', $result);
|
||||
$this->assertContains('ADD KEY `group_idx` (`group2`),', $result);
|
||||
$this->assertContains('ADD KEY `compound_idx` (`group2`, `group1`);', $result);
|
||||
$this->assertStringContainsString("ALTER TABLE $table", $result);
|
||||
$this->assertStringContainsString('DROP PRIMARY KEY,', $result);
|
||||
$this->assertStringContainsString('DROP KEY `name_idx`,', $result);
|
||||
$this->assertStringContainsString('DROP KEY `group_idx`,', $result);
|
||||
$this->assertStringContainsString('DROP KEY `compound_idx`,', $result);
|
||||
$this->assertStringContainsString('ADD KEY `id_name_idx` (`id`, `name`),', $result);
|
||||
$this->assertStringContainsString('ADD UNIQUE KEY `name_idx` (`name`),', $result);
|
||||
$this->assertStringContainsString('ADD KEY `group_idx` (`group2`),', $result);
|
||||
$this->assertStringContainsString('ADD KEY `compound_idx` (`group2`, `group1`);', $result);
|
||||
|
||||
$query = $this->Dbo->getConnection()->prepare($result);
|
||||
$this->assertEquals($query->queryString, $result);
|
||||
|
@ -623,11 +623,11 @@ class MysqlTest extends CakeTestCase {
|
|||
// Drop the indexes
|
||||
$result = $this->Dbo->alterSchema($schemaA->compare($schemaC));
|
||||
|
||||
$this->assertContains("ALTER TABLE $table", $result);
|
||||
$this->assertContains('DROP KEY `name_idx`,', $result);
|
||||
$this->assertContains('DROP KEY `group_idx`,', $result);
|
||||
$this->assertContains('DROP KEY `compound_idx`,', $result);
|
||||
$this->assertContains('DROP KEY `id_name_idx`;', $result);
|
||||
$this->assertStringContainsString("ALTER TABLE $table", $result);
|
||||
$this->assertStringContainsString('DROP KEY `name_idx`,', $result);
|
||||
$this->assertStringContainsString('DROP KEY `group_idx`,', $result);
|
||||
$this->assertStringContainsString('DROP KEY `compound_idx`,', $result);
|
||||
$this->assertStringContainsString('DROP KEY `id_name_idx`;', $result);
|
||||
|
||||
$query = $this->Dbo->getConnection()->prepare($result);
|
||||
$this->assertEquals($query->queryString, $result);
|
||||
|
@ -687,10 +687,10 @@ class MysqlTest extends CakeTestCase {
|
|||
)
|
||||
));
|
||||
$result = $this->Dbo->alterSchema($schemaB->compare($schemaA));
|
||||
$this->assertContains('DEFAULT CHARSET=utf8', $result);
|
||||
$this->assertContains('ENGINE=InnoDB', $result);
|
||||
$this->assertContains('COLLATE=utf8_general_ci', $result);
|
||||
$this->assertContains('COMMENT=\'Newly table added comment.\'', $result);
|
||||
$this->assertStringContainsString('DEFAULT CHARSET=utf8', $result);
|
||||
$this->assertStringContainsString('ENGINE=InnoDB', $result);
|
||||
$this->assertStringContainsString('COLLATE=utf8_general_ci', $result);
|
||||
$this->assertStringContainsString('COMMENT=\'Newly table added comment.\'', $result);
|
||||
|
||||
$this->Dbo->rawQuery($result);
|
||||
$result = $this->Dbo->listDetailedSources($this->Dbo->fullTableName('altertest', false, false));
|
||||
|
@ -896,7 +896,7 @@ SQL;
|
|||
'testdescribes' => $result
|
||||
));
|
||||
$result = $this->Dbo->createSchema($schema);
|
||||
$this->assertContains('`limit_date` timestamp NOT NULL,', $result);
|
||||
$this->assertStringContainsString('`limit_date` timestamp NOT NULL,', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -934,7 +934,7 @@ SQL;
|
|||
'testdescribes' => $result
|
||||
));
|
||||
$result = $this->Dbo->createSchema($schema);
|
||||
$this->assertContains('`limit_date` datetime NOT NULL,', $result);
|
||||
$this->assertStringContainsString('`limit_date` datetime NOT NULL,', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1007,8 +1007,8 @@ SQL;
|
|||
));
|
||||
|
||||
$result = $this->Dbo->createSchema($schema);
|
||||
$this->assertContains('`role_id` int(11) NOT NULL,', $result);
|
||||
$this->assertContains('`user_id` int(11) NOT NULL,', $result);
|
||||
$this->assertStringContainsString('`role_id` int(11) NOT NULL,', $result);
|
||||
$this->assertStringContainsString('`user_id` int(11) NOT NULL,', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1026,7 +1026,7 @@ SQL;
|
|||
)
|
||||
);
|
||||
$result = $this->Dbo->createSchema($schema, 'no_indexes');
|
||||
$this->assertContains('PRIMARY KEY (`id`)', $result);
|
||||
$this->assertStringContainsString('PRIMARY KEY (`id`)', $result);
|
||||
$this->assertNotContains('UNIQUE KEY', $result);
|
||||
|
||||
$schema->tables = array(
|
||||
|
@ -1040,8 +1040,8 @@ SQL;
|
|||
)
|
||||
);
|
||||
$result = $this->Dbo->createSchema($schema, 'primary_index');
|
||||
$this->assertContains('PRIMARY KEY (`id`)', $result);
|
||||
$this->assertContains('UNIQUE KEY `some_index` (`data`)', $result);
|
||||
$this->assertStringContainsString('PRIMARY KEY (`id`)', $result);
|
||||
$this->assertStringContainsString('UNIQUE KEY `some_index` (`data`)', $result);
|
||||
|
||||
$schema->tables = array(
|
||||
'primary_flag_has_index' => array(
|
||||
|
@ -1053,8 +1053,8 @@ SQL;
|
|||
)
|
||||
);
|
||||
$result = $this->Dbo->createSchema($schema, 'primary_flag_has_index');
|
||||
$this->assertContains('PRIMARY KEY (`id`)', $result);
|
||||
$this->assertContains('UNIQUE KEY `some_index` (`data`)', $result);
|
||||
$this->assertStringContainsString('PRIMARY KEY (`id`)', $result);
|
||||
$this->assertStringContainsString('UNIQUE KEY `some_index` (`data`)', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -568,8 +568,8 @@ class PostgresTest extends CakeTestCase {
|
|||
|
||||
$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);
|
||||
$this->assertStringContainsString('timestamp ,', $result);
|
||||
$this->assertStringContainsString('"huge_int" bigint NOT NULL,', $result);
|
||||
|
||||
$db1->query('DROP TABLE ' . $db1->fullTableName('datatype_tests'));
|
||||
|
||||
|
@ -612,7 +612,7 @@ class PostgresTest extends CakeTestCase {
|
|||
);
|
||||
$result = $db1->createSchema($schema, 'bigserial_tests');
|
||||
|
||||
$this->assertContains('"id" bigserial NOT NULL,', $result);
|
||||
$this->assertStringContainsString('"id" bigserial NOT NULL,', $result);
|
||||
|
||||
$db1->query('DROP TABLE ' . $db1->fullTableName('bigserial_tests'));
|
||||
}
|
||||
|
@ -864,8 +864,8 @@ class PostgresTest extends CakeTestCase {
|
|||
)
|
||||
)
|
||||
));
|
||||
$this->assertContains('RENAME "title" TO "subject";', $query);
|
||||
$this->assertContains('ALTER COLUMN "subject" TYPE', $query);
|
||||
$this->assertStringContainsString('RENAME "title" TO "subject";', $query);
|
||||
$this->assertStringContainsString('ALTER COLUMN "subject" TYPE', $query);
|
||||
$this->assertNotContains(";\n\tALTER COLUMN \"subject\" TYPE", $query);
|
||||
$this->assertNotContains('ALTER COLUMN "title" TYPE "subject"', $query);
|
||||
}
|
||||
|
|
|
@ -499,7 +499,7 @@ SQL;
|
|||
'testdescribes' => $result
|
||||
));
|
||||
$result = $this->Dbo->createSchema($schema);
|
||||
$this->assertContains('"limit_date" timestamp NOT NULL', $result);
|
||||
$this->assertStringContainsString('"limit_date" timestamp NOT NULL', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1248,10 +1248,10 @@ class DboSourceTest extends CakeTestCase {
|
|||
);
|
||||
|
||||
$result = $this->db->generateAssociationQuery($Article, null, null, null, null, $queryData, false);
|
||||
$this->assertContains('SELECT', $result);
|
||||
$this->assertContains('FROM', $result);
|
||||
$this->assertContains('WHERE', $result);
|
||||
$this->assertContains('ORDER', $result);
|
||||
$this->assertStringContainsString('SELECT', $result);
|
||||
$this->assertStringContainsString('FROM', $result);
|
||||
$this->assertStringContainsString('WHERE', $result);
|
||||
$this->assertStringContainsString('ORDER', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1229,39 +1229,39 @@ class ModelIntegrationTest extends BaseModelTest {
|
|||
|
||||
$TestModel = new Apple();
|
||||
$TestModel->setDataSource('database1');
|
||||
$this->assertContains('aaa_apples', $this->db->fullTableName($TestModel));
|
||||
$this->assertContains('aaa_apples', $db1->fullTableName($TestModel));
|
||||
$this->assertContains('aaa_apples', $db2->fullTableName($TestModel));
|
||||
$this->assertStringContainsString('aaa_apples', $this->db->fullTableName($TestModel));
|
||||
$this->assertStringContainsString('aaa_apples', $db1->fullTableName($TestModel));
|
||||
$this->assertStringContainsString('aaa_apples', $db2->fullTableName($TestModel));
|
||||
|
||||
$TestModel->setDataSource('database2');
|
||||
$this->assertContains('bbb_apples', $this->db->fullTableName($TestModel));
|
||||
$this->assertContains('bbb_apples', $db1->fullTableName($TestModel));
|
||||
$this->assertContains('bbb_apples', $db2->fullTableName($TestModel));
|
||||
$this->assertStringContainsString('bbb_apples', $this->db->fullTableName($TestModel));
|
||||
$this->assertStringContainsString('bbb_apples', $db1->fullTableName($TestModel));
|
||||
$this->assertStringContainsString('bbb_apples', $db2->fullTableName($TestModel));
|
||||
|
||||
$TestModel = new Apple();
|
||||
$TestModel->tablePrefix = 'custom_';
|
||||
$this->assertContains('custom_apples', $this->db->fullTableName($TestModel));
|
||||
$this->assertStringContainsString('custom_apples', $this->db->fullTableName($TestModel));
|
||||
$TestModel->setDataSource('database1');
|
||||
$this->assertContains('custom_apples', $this->db->fullTableName($TestModel));
|
||||
$this->assertContains('custom_apples', $db1->fullTableName($TestModel));
|
||||
$this->assertStringContainsString('custom_apples', $this->db->fullTableName($TestModel));
|
||||
$this->assertStringContainsString('custom_apples', $db1->fullTableName($TestModel));
|
||||
|
||||
$TestModel = new Apple();
|
||||
$TestModel->setDataSource('database1');
|
||||
$this->assertContains('aaa_apples', $this->db->fullTableName($TestModel));
|
||||
$this->assertStringContainsString('aaa_apples', $this->db->fullTableName($TestModel));
|
||||
$TestModel->tablePrefix = '';
|
||||
$TestModel->setDataSource('database2');
|
||||
$this->assertContains('apples', $db2->fullTableName($TestModel));
|
||||
$this->assertContains('apples', $db1->fullTableName($TestModel));
|
||||
$this->assertStringContainsString('apples', $db2->fullTableName($TestModel));
|
||||
$this->assertStringContainsString('apples', $db1->fullTableName($TestModel));
|
||||
|
||||
$TestModel->tablePrefix = null;
|
||||
$TestModel->setDataSource('database1');
|
||||
$this->assertContains('aaa_apples', $db2->fullTableName($TestModel));
|
||||
$this->assertContains('aaa_apples', $db1->fullTableName($TestModel));
|
||||
$this->assertStringContainsString('aaa_apples', $db2->fullTableName($TestModel));
|
||||
$this->assertStringContainsString('aaa_apples', $db1->fullTableName($TestModel));
|
||||
|
||||
$TestModel->tablePrefix = false;
|
||||
$TestModel->setDataSource('database2');
|
||||
$this->assertContains('apples', $db2->fullTableName($TestModel));
|
||||
$this->assertContains('apples', $db1->fullTableName($TestModel));
|
||||
$this->assertStringContainsString('apples', $db2->fullTableName($TestModel));
|
||||
$this->assertStringContainsString('apples', $db1->fullTableName($TestModel));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -232,7 +232,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
->transport('Debug');
|
||||
|
||||
$result = $this->CakeEmail->send();
|
||||
$this->assertContains('From: "70:20:00 \" Forum" <info@example.com>', $result['headers']);
|
||||
$this->assertStringContainsString('From: "70:20:00 \" Forum" <info@example.com>', $result['headers']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1016,7 +1016,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
));
|
||||
|
||||
$result = $this->CakeEmail->send();
|
||||
$this->assertContains('A message to you', $result['message']);
|
||||
$this->assertStringContainsString('A message to you', $result['message']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1102,7 +1102,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$result = $this->CakeEmail->send('Hello');
|
||||
|
||||
$boundary = $this->CakeEmail->getBoundary();
|
||||
$this->assertContains('Content-Type: multipart/mixed; boundary="' . $boundary . '"', $result['headers']);
|
||||
$this->assertStringContainsString('Content-Type: multipart/mixed; boundary="' . $boundary . '"', $result['headers']);
|
||||
$expected = "--$boundary\r\n" .
|
||||
"Content-Type: text/plain; charset=UTF-8\r\n" .
|
||||
"Content-Transfer-Encoding: 8bit\r\n" .
|
||||
|
@ -1115,7 +1115,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
"Content-Type: text/x-php\r\n" .
|
||||
"Content-Transfer-Encoding: base64\r\n" .
|
||||
"Content-Disposition: attachment; filename=\"basics.php\"\r\n\r\n";
|
||||
$this->assertContains($expected, $result['message']);
|
||||
$this->assertStringContainsString($expected, $result['message']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1138,7 +1138,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$result = $this->CakeEmail->send('Hello');
|
||||
|
||||
$boundary = $this->CakeEmail->getBoundary();
|
||||
$this->assertContains('Content-Type: multipart/mixed; boundary="' . $boundary . '"', $result['headers']);
|
||||
$this->assertStringContainsString('Content-Type: multipart/mixed; boundary="' . $boundary . '"', $result['headers']);
|
||||
$expected = "--$boundary\r\n" .
|
||||
"Content-Type: text/plain; charset=UTF-8\r\n" .
|
||||
"Content-Transfer-Encoding: 8bit\r\n" .
|
||||
|
@ -1152,7 +1152,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
"Content-Transfer-Encoding: base64\r\n" .
|
||||
"Content-Disposition: attachment; filename=\"cake.icon.png\"\r\n\r\n";
|
||||
$expected .= chunk_split(base64_encode($data), 76, "\r\n");
|
||||
$this->assertContains($expected, $result['message']);
|
||||
$this->assertStringContainsString($expected, $result['message']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1173,7 +1173,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$result = $this->CakeEmail->send('Hello');
|
||||
|
||||
$boundary = $this->CakeEmail->getBoundary();
|
||||
$this->assertContains('Content-Type: multipart/mixed; boundary="' . $boundary . '"', $result['headers']);
|
||||
$this->assertStringContainsString('Content-Type: multipart/mixed; boundary="' . $boundary . '"', $result['headers']);
|
||||
$expected = "--$boundary\r\n" .
|
||||
"Content-Type: text/plain; charset=UTF-8\r\n" .
|
||||
"Content-Transfer-Encoding: 8bit\r\n" .
|
||||
|
@ -1187,7 +1187,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
"Content-Transfer-Encoding: base64\r\n" .
|
||||
"Content-Disposition: attachment; filename=\"cake.icon.png\"\r\n\r\n";
|
||||
$expected .= chunk_split(base64_encode($data), 76, "\r\n");
|
||||
$this->assertContains($expected, $result['message']);
|
||||
$this->assertStringContainsString($expected, $result['message']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1205,7 +1205,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$result = $this->CakeEmail->send('Hello');
|
||||
|
||||
$boundary = $this->CakeEmail->getBoundary();
|
||||
$this->assertContains('Content-Type: multipart/mixed; boundary="' . $boundary . '"', $result['headers']);
|
||||
$this->assertStringContainsString('Content-Type: multipart/mixed; boundary="' . $boundary . '"', $result['headers']);
|
||||
$expected = "--$boundary\r\n" .
|
||||
"Content-Type: multipart/alternative; boundary=\"alt-$boundary\"\r\n" .
|
||||
"\r\n" .
|
||||
|
@ -1231,7 +1231,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
"Content-Type: text/plain\r\n" .
|
||||
"Content-Transfer-Encoding: base64\r\n" .
|
||||
"Content-Disposition: attachment; filename=\"VERSION.txt\"\r\n\r\n";
|
||||
$this->assertContains($expected, $result['message']);
|
||||
$this->assertStringContainsString($expected, $result['message']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1254,7 +1254,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$result = $this->CakeEmail->send('Hello');
|
||||
|
||||
$boundary = $this->CakeEmail->getBoundary();
|
||||
$this->assertContains('Content-Type: multipart/mixed; boundary="' . $boundary . '"', $result['headers']);
|
||||
$this->assertStringContainsString('Content-Type: multipart/mixed; boundary="' . $boundary . '"', $result['headers']);
|
||||
$expected = "--$boundary\r\n" .
|
||||
"Content-Type: multipart/related; boundary=\"rel-$boundary\"\r\n" .
|
||||
"\r\n" .
|
||||
|
@ -1284,9 +1284,9 @@ class CakeEmailTest extends CakeTestCase {
|
|||
"Content-Transfer-Encoding: base64\r\n" .
|
||||
"Content-ID: <abc123>\r\n" .
|
||||
"Content-Disposition: inline; filename=\"cake.png\"\r\n\r\n";
|
||||
$this->assertContains($expected, $result['message']);
|
||||
$this->assertContains('--rel-' . $boundary . '--', $result['message']);
|
||||
$this->assertContains('--' . $boundary . '--', $result['message']);
|
||||
$this->assertStringContainsString($expected, $result['message']);
|
||||
$this->assertStringContainsString('--rel-' . $boundary . '--', $result['message']);
|
||||
$this->assertStringContainsString('--' . $boundary . '--', $result['message']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1309,7 +1309,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$result = $this->CakeEmail->send('Hello');
|
||||
|
||||
$boundary = $this->CakeEmail->getBoundary();
|
||||
$this->assertContains('Content-Type: multipart/mixed; boundary="' . $boundary . '"', $result['headers']);
|
||||
$this->assertStringContainsString('Content-Type: multipart/mixed; boundary="' . $boundary . '"', $result['headers']);
|
||||
$expected = "--$boundary\r\n" .
|
||||
"Content-Type: multipart/related; boundary=\"rel-$boundary\"\r\n" .
|
||||
"\r\n" .
|
||||
|
@ -1326,9 +1326,9 @@ class CakeEmailTest extends CakeTestCase {
|
|||
"Content-Transfer-Encoding: base64\r\n" .
|
||||
"Content-ID: <abc123>\r\n" .
|
||||
"Content-Disposition: inline; filename=\"cake.png\"\r\n\r\n";
|
||||
$this->assertContains($expected, $result['message']);
|
||||
$this->assertContains('--rel-' . $boundary . '--', $result['message']);
|
||||
$this->assertContains('--' . $boundary . '--', $result['message']);
|
||||
$this->assertStringContainsString($expected, $result['message']);
|
||||
$this->assertStringContainsString('--rel-' . $boundary . '--', $result['message']);
|
||||
$this->assertStringContainsString('--' . $boundary . '--', $result['message']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1351,7 +1351,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$result = $this->CakeEmail->send('Hello');
|
||||
|
||||
$boundary = $this->CakeEmail->getBoundary();
|
||||
$this->assertContains('Content-Type: multipart/mixed; boundary="' . $boundary . '"', $result['headers']);
|
||||
$this->assertStringContainsString('Content-Type: multipart/mixed; boundary="' . $boundary . '"', $result['headers']);
|
||||
$expected = "--$boundary\r\n" .
|
||||
"Content-Type: text/plain; charset=UTF-8\r\n" .
|
||||
"Content-Transfer-Encoding: 8bit\r\n" .
|
||||
|
@ -1365,8 +1365,8 @@ class CakeEmailTest extends CakeTestCase {
|
|||
"Content-Transfer-Encoding: base64\r\n" .
|
||||
"\r\n";
|
||||
|
||||
$this->assertContains($expected, $result['message']);
|
||||
$this->assertContains('--' . $boundary . '--', $result['message']);
|
||||
$this->assertStringContainsString($expected, $result['message']);
|
||||
$this->assertStringContainsString('--' . $boundary . '--', $result['message']);
|
||||
}
|
||||
/**
|
||||
* testSendWithLog method
|
||||
|
@ -1440,9 +1440,9 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$this->CakeEmail->template('default', 'default');
|
||||
$result = $this->CakeEmail->send();
|
||||
|
||||
$this->assertContains('This email was sent using the CakePHP Framework', $result['message']);
|
||||
$this->assertContains('Message-ID: ', $result['headers']);
|
||||
$this->assertContains('To: ', $result['headers']);
|
||||
$this->assertStringContainsString('This email was sent using the CakePHP Framework', $result['message']);
|
||||
$this->assertStringContainsString('Message-ID: ', $result['headers']);
|
||||
$this->assertStringContainsString('To: ', $result['headers']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1461,7 +1461,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$this->CakeEmail->template('default', null);
|
||||
$result = $this->CakeEmail->send('message body.');
|
||||
|
||||
$this->assertContains('message body.', $result['message']);
|
||||
$this->assertStringContainsString('message body.', $result['message']);
|
||||
$this->assertNotContains('This email was sent using the CakePHP Framework', $result['message']);
|
||||
}
|
||||
|
||||
|
@ -1482,11 +1482,11 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$this->CakeEmail->emailFormat('both');
|
||||
$result = $this->CakeEmail->send();
|
||||
|
||||
$this->assertContains('Message-ID: ', $result['headers']);
|
||||
$this->assertContains('To: ', $result['headers']);
|
||||
$this->assertStringContainsString('Message-ID: ', $result['headers']);
|
||||
$this->assertStringContainsString('To: ', $result['headers']);
|
||||
|
||||
$boundary = $this->CakeEmail->getBoundary();
|
||||
$this->assertContains('Content-Type: multipart/alternative; boundary="' . $boundary . '"', $result['headers']);
|
||||
$this->assertStringContainsString('Content-Type: multipart/alternative; boundary="' . $boundary . '"', $result['headers']);
|
||||
|
||||
$expected = "--$boundary\r\n" .
|
||||
"Content-Type: text/plain; charset=UTF-8\r\n" .
|
||||
|
@ -1531,9 +1531,9 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$result = $this->CakeEmail->send();
|
||||
|
||||
$expected = mb_convert_encoding('CakePHP Framework を使って送信したメールです。 https://cakephp.org.', 'ISO-2022-JP');
|
||||
$this->assertContains($expected, $result['message']);
|
||||
$this->assertContains('Message-ID: ', $result['headers']);
|
||||
$this->assertContains('To: ', $result['headers']);
|
||||
$this->assertStringContainsString($expected, $result['message']);
|
||||
$this->assertStringContainsString('Message-ID: ', $result['headers']);
|
||||
$this->assertStringContainsString('To: ', $result['headers']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1553,10 +1553,10 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$this->CakeEmail->template('themed', 'default');
|
||||
$result = $this->CakeEmail->send();
|
||||
|
||||
$this->assertContains('In TestTheme', $result['message']);
|
||||
$this->assertContains('Message-ID: ', $result['headers']);
|
||||
$this->assertContains('To: ', $result['headers']);
|
||||
$this->assertContains('/theme/TestTheme/img/test.jpg', $result['message']);
|
||||
$this->assertStringContainsString('In TestTheme', $result['message']);
|
||||
$this->assertStringContainsString('Message-ID: ', $result['headers']);
|
||||
$this->assertStringContainsString('To: ', $result['headers']);
|
||||
$this->assertStringContainsString('/theme/TestTheme/img/test.jpg', $result['message']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1597,7 +1597,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$this->CakeEmail->viewVars(array('value' => 12345));
|
||||
$result = $this->CakeEmail->send();
|
||||
|
||||
$this->assertContains('Here is your value: 12345', $result['message']);
|
||||
$this->assertStringContainsString('Here is your value: 12345', $result['message']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1673,7 +1673,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
|
||||
$expected = '<img src="http://' . $server . '/img/image.gif" alt="cool image" width="100" height="100"/>';
|
||||
$result = $this->CakeEmail->send();
|
||||
$this->assertContains($expected, $result['message']);
|
||||
$this->assertStringContainsString($expected, $result['message']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1695,35 +1695,35 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$this->CakeEmail->config(array('empty'));
|
||||
|
||||
$result = $this->CakeEmail->template('TestPlugin.test_plugin_tpl', 'default')->send();
|
||||
$this->assertContains('Into TestPlugin.', $result['message']);
|
||||
$this->assertContains('This email was sent using the CakePHP Framework', $result['message']);
|
||||
$this->assertStringContainsString('Into TestPlugin.', $result['message']);
|
||||
$this->assertStringContainsString('This email was sent using the CakePHP Framework', $result['message']);
|
||||
|
||||
$result = $this->CakeEmail->template('TestPlugin.test_plugin_tpl', 'TestPlugin.plug_default')->send();
|
||||
$this->assertContains('Into TestPlugin.', $result['message']);
|
||||
$this->assertContains('This email was sent using the TestPlugin.', $result['message']);
|
||||
$this->assertStringContainsString('Into TestPlugin.', $result['message']);
|
||||
$this->assertStringContainsString('This email was sent using the TestPlugin.', $result['message']);
|
||||
|
||||
$result = $this->CakeEmail->template('TestPlugin.test_plugin_tpl', 'plug_default')->send();
|
||||
$this->assertContains('Into TestPlugin.', $result['message']);
|
||||
$this->assertContains('This email was sent using the TestPlugin.', $result['message']);
|
||||
$this->assertStringContainsString('Into TestPlugin.', $result['message']);
|
||||
$this->assertStringContainsString('This email was sent using the TestPlugin.', $result['message']);
|
||||
|
||||
$this->CakeEmail->template(
|
||||
'TestPlugin.test_plugin_tpl',
|
||||
'TestPluginTwo.default'
|
||||
);
|
||||
$result = $this->CakeEmail->send();
|
||||
$this->assertContains('Into TestPlugin.', $result['message']);
|
||||
$this->assertContains('This email was sent using TestPluginTwo.', $result['message']);
|
||||
$this->assertStringContainsString('Into TestPlugin.', $result['message']);
|
||||
$this->assertStringContainsString('This email was sent using TestPluginTwo.', $result['message']);
|
||||
|
||||
// test plugin template overridden by theme
|
||||
$this->CakeEmail->theme('TestTheme');
|
||||
$result = $this->CakeEmail->send();
|
||||
|
||||
$this->assertContains('Into TestPlugin. (themed)', $result['message']);
|
||||
$this->assertStringContainsString('Into TestPlugin. (themed)', $result['message']);
|
||||
|
||||
$this->CakeEmail->viewVars(array('value' => 12345));
|
||||
$result = $this->CakeEmail->template('custom', 'TestPlugin.plug_default')->send();
|
||||
$this->assertContains('Here is your value: 12345', $result['message']);
|
||||
$this->assertContains('This email was sent using the TestPlugin.', $result['message']);
|
||||
$this->assertStringContainsString('Here is your value: 12345', $result['message']);
|
||||
$this->assertStringContainsString('This email was sent using the TestPlugin.', $result['message']);
|
||||
|
||||
$this->setExpectedException('MissingViewException');
|
||||
$this->CakeEmail->template('test_plugin_tpl', 'plug_default')->send();
|
||||
|
@ -1779,19 +1779,19 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$this->CakeEmail->config(array());
|
||||
$this->CakeEmail->attachments(array(CAKE . 'basics.php'));
|
||||
$result = $this->CakeEmail->send('body');
|
||||
$this->assertContains("Content-Type: text/x-php\r\nContent-Transfer-Encoding: base64\r\nContent-Disposition: attachment; filename=\"basics.php\"", $result['message']);
|
||||
$this->assertStringContainsString("Content-Type: text/x-php\r\nContent-Transfer-Encoding: base64\r\nContent-Disposition: attachment; filename=\"basics.php\"", $result['message']);
|
||||
|
||||
$this->CakeEmail->attachments(array('my.file.txt' => CAKE . 'basics.php'));
|
||||
$result = $this->CakeEmail->send('body');
|
||||
$this->assertContains("Content-Type: text/x-php\r\nContent-Transfer-Encoding: base64\r\nContent-Disposition: attachment; filename=\"my.file.txt\"", $result['message']);
|
||||
$this->assertStringContainsString("Content-Type: text/x-php\r\nContent-Transfer-Encoding: base64\r\nContent-Disposition: attachment; filename=\"my.file.txt\"", $result['message']);
|
||||
|
||||
$this->CakeEmail->attachments(array('file.txt' => array('file' => CAKE . 'basics.php', 'mimetype' => 'text/plain')));
|
||||
$result = $this->CakeEmail->send('body');
|
||||
$this->assertContains("Content-Type: text/plain\r\nContent-Transfer-Encoding: base64\r\nContent-Disposition: attachment; filename=\"file.txt\"", $result['message']);
|
||||
$this->assertStringContainsString("Content-Type: text/plain\r\nContent-Transfer-Encoding: base64\r\nContent-Disposition: attachment; filename=\"file.txt\"", $result['message']);
|
||||
|
||||
$this->CakeEmail->attachments(array('file2.txt' => array('file' => CAKE . 'basics.php', 'mimetype' => 'text/plain', 'contentId' => 'a1b1c1')));
|
||||
$result = $this->CakeEmail->send('body');
|
||||
$this->assertContains("Content-Type: text/plain\r\nContent-Transfer-Encoding: base64\r\nContent-ID: <a1b1c1>\r\nContent-Disposition: inline; filename=\"file2.txt\"", $result['message']);
|
||||
$this->assertStringContainsString("Content-Type: text/plain\r\nContent-Transfer-Encoding: base64\r\nContent-ID: <a1b1c1>\r\nContent-Disposition: inline; filename=\"file2.txt\"", $result['message']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1846,10 +1846,10 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$this->CakeEmail->send();
|
||||
|
||||
$expected = '<p>This email was sent using the <a href="https://cakephp.org">CakePHP Framework</a></p>';
|
||||
$this->assertContains($expected, $this->CakeEmail->message(CakeEmail::MESSAGE_HTML));
|
||||
$this->assertStringContainsString($expected, $this->CakeEmail->message(CakeEmail::MESSAGE_HTML));
|
||||
|
||||
$expected = 'This email was sent using the CakePHP Framework, https://cakephp.org.';
|
||||
$this->assertContains($expected, $this->CakeEmail->message(CakeEmail::MESSAGE_TEXT));
|
||||
$this->assertStringContainsString($expected, $this->CakeEmail->message(CakeEmail::MESSAGE_TEXT));
|
||||
|
||||
$message = $this->CakeEmail->message();
|
||||
$this->assertContains('Content-Type: text/plain; charset=UTF-8', $message);
|
||||
|
@ -2134,11 +2134,11 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$email->subject('あれ?もしかしての前と');
|
||||
$headers = $email->getHeaders(array('subject'));
|
||||
$expected = "?ISO-2022-JP?B?GyRCJCIkbCEpJGIkNyQrJDckRiROQTAkSBsoQg==?=";
|
||||
$this->assertContains($expected, $headers['Subject']);
|
||||
$this->assertStringContainsString($expected, $headers['Subject']);
|
||||
|
||||
$email->to('someone@example.com')->from('someone@example.com');
|
||||
$result = $email->send('ってテーブルを作ってやってたらう');
|
||||
$this->assertContains('ってテーブルを作ってやってたらう', $result['message']);
|
||||
$this->assertStringContainsString('ってテーブルを作ってやってたらう', $result['message']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2156,12 +2156,12 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$email->subject('あれ?もしかしての前と');
|
||||
$headers = $email->getHeaders(array('subject'));
|
||||
$expected = "?ISO-2022-JP?B?GyRCJCIkbCEpJGIkNyQrJDckRiROQTAkSBsoQg==?=";
|
||||
$this->assertContains($expected, $headers['Subject']);
|
||||
$this->assertStringContainsString($expected, $headers['Subject']);
|
||||
|
||||
$email->to('someone@example.com')->from('someone@example.com');
|
||||
$result = $email->send('ってテーブルを作ってやってたらう');
|
||||
$this->assertContains('Content-Type: text/plain; charset=ISO-2022-JP', $result['headers']);
|
||||
$this->assertContains(mb_convert_encoding('ってテーブルを作ってやってたらう', 'ISO-2022-JP'), $result['message']);
|
||||
$this->assertStringContainsString('Content-Type: text/plain; charset=ISO-2022-JP', $result['headers']);
|
||||
$this->assertStringContainsString(mb_convert_encoding('ってテーブルを作ってやってたらう', 'ISO-2022-JP'), $result['message']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2179,7 +2179,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$email->subject('あれ?もしかしての前と');
|
||||
$headers = $email->getHeaders(array('subject'));
|
||||
$expected = "?ISO-2022-JP?B?GyRCJCIkbCEpJGIkNyQrJDckRiROQTAkSBsoQg==?=";
|
||||
$this->assertContains($expected, $headers['Subject']);
|
||||
$this->assertStringContainsString($expected, $headers['Subject']);
|
||||
|
||||
$email->to('someone@example.com')->from('someone@example.com');
|
||||
$result = $email->send('①㈱');
|
||||
|
@ -2203,13 +2203,13 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$email->subject('あれ?もしかしての前と');
|
||||
$headers = $email->getHeaders(array('subject'));
|
||||
$expected = "?ISO-2022-JP?B?GyRCJCIkbCEpJGIkNyQrJDckRiROQTAkSBsoQg==?=";
|
||||
$this->assertContains($expected, $headers['Subject']);
|
||||
$this->assertStringContainsString($expected, $headers['Subject']);
|
||||
|
||||
$email->to('someone@example.com')->from('someone@example.com');
|
||||
$result = $email->send('①㈱');
|
||||
$this->assertTextContains("Content-Type: text/plain; charset=ISO-2022-JP", $result['headers']);
|
||||
$this->assertTextNotContains("Content-Type: text/plain; charset=iso-2022-jp-ms", $result['headers']); // not charset=iso-2022-jp-ms
|
||||
$this->assertContains(mb_convert_encoding('①㈱', 'ISO-2022-JP-MS'), $result['message']);
|
||||
$this->assertStringContainsString(mb_convert_encoding('①㈱', 'ISO-2022-JP-MS'), $result['message']);
|
||||
}
|
||||
|
||||
protected function _checkContentTransferEncoding($message, $charset) {
|
||||
|
@ -2550,8 +2550,8 @@ HTML;
|
|||
$this->CakeEmail->emailFormat('html');
|
||||
$this->CakeEmail->template('long_line', null);
|
||||
$result = $this->CakeEmail->send();
|
||||
$this->assertContains('<a>', $result['message'], 'First bits are included');
|
||||
$this->assertContains('x', $result['message'], 'Last byte are included');
|
||||
$this->assertStringContainsString('<a>', $result['message'], 'First bits are included');
|
||||
$this->assertStringContainsString('x', $result['message'], 'Last byte are included');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -86,8 +86,8 @@ class MailTransportTest extends CakeTestCase {
|
|||
|
||||
$result = $this->MailTransport->send($email);
|
||||
|
||||
$this->assertContains('Subject: ', $result['headers']);
|
||||
$this->assertContains('To: ', $result['headers']);
|
||||
$this->assertStringContainsString('Subject: ', $result['headers']);
|
||||
$this->assertStringContainsString('To: ', $result['headers']);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -594,7 +594,7 @@ class HttpSocketTest extends CakeTestCase {
|
|||
'method' => 'GET'
|
||||
);
|
||||
$this->Socket->request($request);
|
||||
$this->assertContains('Host: cakephp.org:8080', $this->Socket->request['header']);
|
||||
$this->assertStringContainsString('Host: cakephp.org:8080', $this->Socket->request['header']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -618,7 +618,7 @@ class HttpSocketTest extends CakeTestCase {
|
|||
'method' => 'GET'
|
||||
);
|
||||
$this->Socket->request($request);
|
||||
$this->assertContains("GET /index.php?somestring HTTP/1.1", $this->Socket->request['line']);
|
||||
$this->assertStringContainsString("GET /index.php?somestring HTTP/1.1", $this->Socket->request['line']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1845,7 +1845,7 @@ class HttpSocketTest extends CakeTestCase {
|
|||
} catch (SocketException $e) {
|
||||
$message = $e->getMessage();
|
||||
$this->skipIf(strpos($message, 'Invalid HTTP') !== false, 'Invalid HTTP Response received, skipping.');
|
||||
$this->assertContains('Failed to enable crypto', $message);
|
||||
$this->assertStringContainsString('Failed to enable crypto', $message);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -380,7 +380,7 @@ class CakeTestCaseTest extends CakeTestCase {
|
|||
*/
|
||||
public function testAssertTextContains() {
|
||||
$stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!";
|
||||
$this->assertContains("different", $stringDirty);
|
||||
$this->assertStringContainsString("different", $stringDirty);
|
||||
$this->assertNotContains("different\rline", $stringDirty);
|
||||
$this->assertTextContains("different\rline", $stringDirty);
|
||||
}
|
||||
|
|
|
@ -602,24 +602,24 @@ class ControllerTestCaseTest extends CakeTestCase {
|
|||
'method' => 'get',
|
||||
'return' => 'contents',
|
||||
));
|
||||
$this->assertContains('<html', $result);
|
||||
$this->assertContains('This is the TestsAppsController index view', $result);
|
||||
$this->assertContains('first call', $result);
|
||||
$this->assertContains('</html>', $result);
|
||||
$this->assertStringContainsString('<html', $result);
|
||||
$this->assertStringContainsString('This is the TestsAppsController index view', $result);
|
||||
$this->assertStringContainsString('first call', $result);
|
||||
$this->assertStringContainsString('</html>', $result);
|
||||
|
||||
$result = $this->Case->testAction('/tests_apps/index', array(
|
||||
'data' => array('var' => 'second call'),
|
||||
'method' => 'get',
|
||||
'return' => 'contents'
|
||||
));
|
||||
$this->assertContains('second call', $result);
|
||||
$this->assertStringContainsString('second call', $result);
|
||||
|
||||
$result = $this->Case->testAction('/tests_apps/index', array(
|
||||
'data' => array('var' => 'third call'),
|
||||
'method' => 'get',
|
||||
'return' => 'contents'
|
||||
));
|
||||
$this->assertContains('third call', $result);
|
||||
$this->assertStringContainsString('third call', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -152,7 +152,7 @@ class DebuggerTest extends CakeTestCase {
|
|||
$this->assertMatchesRegularExpression('/Undefined variable:\s+buzz/', $result[1]);
|
||||
$this->assertMatchesRegularExpression('/<a[^>]+>Code/', $result[1]);
|
||||
$this->assertMatchesRegularExpression('/<a[^>]+>Context/', $result[2]);
|
||||
$this->assertContains('$wrong = ''', $result[3], 'Context should be HTML escaped.');
|
||||
$this->assertStringContainsString('$wrong = ''', $result[3], 'Context should be HTML escaped.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -170,7 +170,7 @@ class DebuggerTest extends CakeTestCase {
|
|||
$result = ob_get_clean();
|
||||
|
||||
$this->assertNotContains('<script>alert(1)', $result);
|
||||
$this->assertContains('<script>alert(1)', $result);
|
||||
$this->assertStringContainsString('<script>alert(1)', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -286,8 +286,8 @@ class DebuggerTest extends CakeTestCase {
|
|||
ob_start();
|
||||
$foo .= '';
|
||||
$result = ob_get_clean();
|
||||
$this->assertContains('Notice: I eated an error', $result);
|
||||
$this->assertContains('DebuggerTest.php', $result);
|
||||
$this->assertStringContainsString('Notice: I eated an error', $result);
|
||||
$this->assertStringContainsString('DebuggerTest.php', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -476,18 +476,18 @@ TEXT;
|
|||
|
||||
Debugger::log('cool');
|
||||
$result = file_get_contents(LOGS . 'debug.log');
|
||||
$this->assertContains('DebuggerTest::testLog', $result);
|
||||
$this->assertContains("'cool'", $result);
|
||||
$this->assertStringContainsString('DebuggerTest::testLog', $result);
|
||||
$this->assertStringContainsString("'cool'", $result);
|
||||
|
||||
unlink(LOGS . 'debug.log');
|
||||
|
||||
Debugger::log(array('whatever', 'here'));
|
||||
$result = file_get_contents(LOGS . 'debug.log');
|
||||
$this->assertContains('DebuggerTest::testLog', $result);
|
||||
$this->assertContains('[main]', $result);
|
||||
$this->assertContains('array', $result);
|
||||
$this->assertContains("'whatever',", $result);
|
||||
$this->assertContains("'here'", $result);
|
||||
$this->assertStringContainsString('DebuggerTest::testLog', $result);
|
||||
$this->assertStringContainsString('[main]', $result);
|
||||
$this->assertStringContainsString('array', $result);
|
||||
$this->assertStringContainsString("'whatever',", $result);
|
||||
$this->assertStringContainsString("'here'", $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -506,7 +506,7 @@ TEXT;
|
|||
);
|
||||
Debugger::log($val, LOG_DEBUG, 0);
|
||||
$result = file_get_contents(LOGS . 'debug.log');
|
||||
$this->assertContains('DebuggerTest::testLog', $result);
|
||||
$this->assertStringContainsString('DebuggerTest::testLog', $result);
|
||||
$this->assertNotContains("/'val'/", $result);
|
||||
|
||||
unlink(LOGS . 'debug.log');
|
||||
|
@ -631,7 +631,7 @@ TEXT;
|
|||
*/
|
||||
public function testExportVarRecursion() {
|
||||
$output = Debugger::exportVar($GLOBALS);
|
||||
$this->assertContains("'GLOBALS' => [recursion]", $output);
|
||||
$this->assertStringContainsString("'GLOBALS' => [recursion]", $output);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -631,7 +631,7 @@ class FileTest extends CakeTestCase {
|
|||
// Double check
|
||||
$expected = 'This is the welcome.tmp file in vendors directory';
|
||||
$contents = $TmpFile->read();
|
||||
$this->assertContains($expected, $contents);
|
||||
$this->assertStringContainsString($expected, $contents);
|
||||
|
||||
$search = array('This is the', 'welcome.php file', 'in tmp directory');
|
||||
$replace = array('This should be a', 'welcome.tmp file', 'in the Lib directory');
|
||||
|
@ -643,7 +643,7 @@ class FileTest extends CakeTestCase {
|
|||
// Double check
|
||||
$expected = 'This should be a welcome.tmp file in vendors directory';
|
||||
$contents = $TmpFile->read();
|
||||
$this->assertContains($expected, $contents);
|
||||
$this->assertStringContainsString($expected, $contents);
|
||||
|
||||
$TmpFile->delete();
|
||||
}
|
||||
|
|
|
@ -1240,7 +1240,7 @@ XML;
|
|||
);
|
||||
$obj = Xml::build($data);
|
||||
$result = $obj->asXml();
|
||||
$this->assertContains('mark & mark', $result);
|
||||
$this->assertStringContainsString('mark & mark', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -120,15 +120,15 @@ class FlashHelperTest extends CakeTestCase {
|
|||
public function testFlash() {
|
||||
$result = $this->Flash->render();
|
||||
$expected = '<div class="message">This is the first Message</div><div class="message">This is the second Message</div>';
|
||||
$this->assertContains($expected, $result);
|
||||
$this->assertStringContainsString($expected, $result);
|
||||
|
||||
$expected = '<div id="classy-message">Recorded</div>';
|
||||
$result = $this->Flash->render('classy');
|
||||
$this->assertContains($expected, $result);
|
||||
$this->assertStringContainsString($expected, $result);
|
||||
|
||||
$result = $this->Flash->render('notification');
|
||||
$expected = "<div id=\"notificationLayout\">\n\t<h1>Alert!</h1>\n\t<h3>Notice!</h3>\n\t<p>Broadcast message testing</p>\n</div>";
|
||||
$this->assertContains($expected, $result);
|
||||
$this->assertStringContainsString($expected, $result);
|
||||
|
||||
$this->assertNull($this->Flash->render('non-existent'));
|
||||
}
|
||||
|
@ -156,7 +156,7 @@ class FlashHelperTest extends CakeTestCase {
|
|||
|
||||
$expected = "<div id=\"notificationLayout\">\n\t<h1>Notice!</h1>\n\t<h3>Alert!</h3>\n\t<p>Broadcast message testing</p>\n</div>";
|
||||
|
||||
$this->assertContains($expected, $result);
|
||||
$this->assertStringContainsString($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -172,7 +172,7 @@ class FlashHelperTest extends CakeTestCase {
|
|||
|
||||
$result = $this->Flash->render('flash', array('element' => 'TestPlugin.plugin_element'));
|
||||
$expected = 'this is the plugin element';
|
||||
$this->assertContains($expected, $result);
|
||||
$this->assertStringContainsString($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -181,6 +181,6 @@ class FlashHelperTest extends CakeTestCase {
|
|||
public function testFlashFallback() {
|
||||
$result = $this->Flash->render('default');
|
||||
$expected = '<div class="message">Default</div>';
|
||||
$this->assertContains($expected, $result);
|
||||
$this->assertStringContainsString($expected, $result);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1825,15 +1825,15 @@ class FormHelperTest extends CakeTestCase {
|
|||
'url' => array('controller' => 'articles', 'action' => 'view', 1, '?' => array('page' => 1))
|
||||
));
|
||||
$result = $this->Form->secure();
|
||||
$this->assertContains($expected, $result);
|
||||
$this->assertStringContainsString($expected, $result);
|
||||
|
||||
$this->Form->create('Address', array('url' => 'http://localhost/articles/view/1?page=1'));
|
||||
$result = $this->Form->secure();
|
||||
$this->assertContains($expected, $result, 'Full URL should only use path and query.');
|
||||
$this->assertStringContainsString($expected, $result, 'Full URL should only use path and query.');
|
||||
|
||||
$this->Form->create('Address', array('url' => '/articles/view/1?page=1'));
|
||||
$result = $this->Form->secure();
|
||||
$this->assertContains($expected, $result, 'URL path + query should work.');
|
||||
$this->assertStringContainsString($expected, $result, 'URL path + query should work.');
|
||||
|
||||
$this->Form->create('Address', array('url' => '/articles/view/1'));
|
||||
$result = $this->Form->secure();
|
||||
|
@ -1853,7 +1853,7 @@ class FormHelperTest extends CakeTestCase {
|
|||
'url' => array('controller' => 'articles', 'action' => 'view', 1, 'type' => 'red')
|
||||
));
|
||||
$result = $this->Form->secure();
|
||||
$this->assertContains($expected, $result);
|
||||
$this->assertStringContainsString($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1878,15 +1878,15 @@ class FormHelperTest extends CakeTestCase {
|
|||
),
|
||||
));
|
||||
$result = $this->Form->secure();
|
||||
$this->assertContains($expected, $result);
|
||||
$this->assertStringContainsString($expected, $result);
|
||||
|
||||
$this->Form->create('Address', array('url' => 'http://localhost/articles/view?page=1&limit=10&html=%3C%3E%22#result'));
|
||||
$result = $this->Form->secure();
|
||||
$this->assertContains($expected, $result, 'Full URL should only use path and query.');
|
||||
$this->assertStringContainsString($expected, $result, 'Full URL should only use path and query.');
|
||||
|
||||
$this->Form->create('Address', array('url' => '/articles/view?page=1&limit=10&html=%3C%3E%22#result'));
|
||||
$result = $this->Form->secure();
|
||||
$this->assertContains($expected, $result, 'URL path + query should work.');
|
||||
$this->assertStringContainsString($expected, $result, 'URL path + query should work.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2946,18 +2946,18 @@ class FormHelperTest extends CakeTestCase {
|
|||
'type' => 'time',
|
||||
'selected' => '18:15'
|
||||
));
|
||||
$this->assertContains('<option value="06" selected="selected">6</option>', $result);
|
||||
$this->assertContains('<option value="15" selected="selected">15</option>', $result);
|
||||
$this->assertContains('<option value="pm" selected="selected">pm</option>', $result);
|
||||
$this->assertStringContainsString('<option value="06" selected="selected">6</option>', $result);
|
||||
$this->assertStringContainsString('<option value="15" selected="selected">15</option>', $result);
|
||||
$this->assertStringContainsString('<option value="pm" selected="selected">pm</option>', $result);
|
||||
|
||||
$result = $this->Form->input('published', array('type' => 'time'));
|
||||
$now = strtotime('now');
|
||||
$this->assertContains('<option value="' . date('h', $now) . '" selected="selected">' . date('g', $now) . '</option>', $result);
|
||||
$this->assertStringContainsString('<option value="' . date('h', $now) . '" selected="selected">' . date('g', $now) . '</option>', $result);
|
||||
|
||||
$now = strtotime('2013-03-09 00:42:21');
|
||||
$result = $this->Form->input('published', array('type' => 'time', 'selected' => $now));
|
||||
$this->assertContains('<option value="12" selected="selected">12</option>', $result);
|
||||
$this->assertContains('<option value="42" selected="selected">42</option>', $result);
|
||||
$this->assertStringContainsString('<option value="12" selected="selected">12</option>', $result);
|
||||
$this->assertStringContainsString('<option value="42" selected="selected">42</option>', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2971,18 +2971,18 @@ class FormHelperTest extends CakeTestCase {
|
|||
'interval' => 15,
|
||||
'selected' => array('hour' => '3', 'min' => '57', 'meridian' => 'pm')
|
||||
));
|
||||
$this->assertContains('<option value="04" selected="selected">4</option>', $result);
|
||||
$this->assertContains('<option value="00" selected="selected">00</option>', $result);
|
||||
$this->assertContains('<option value="pm" selected="selected">pm</option>', $result);
|
||||
$this->assertStringContainsString('<option value="04" selected="selected">4</option>', $result);
|
||||
$this->assertStringContainsString('<option value="00" selected="selected">00</option>', $result);
|
||||
$this->assertStringContainsString('<option value="pm" selected="selected">pm</option>', $result);
|
||||
|
||||
$result = $this->Form->input('Model.start_time', array(
|
||||
'type' => 'time',
|
||||
'interval' => 15,
|
||||
'selected' => '2012-10-23 15:57:00'
|
||||
));
|
||||
$this->assertContains('<option value="04" selected="selected">4</option>', $result);
|
||||
$this->assertContains('<option value="00" selected="selected">00</option>', $result);
|
||||
$this->assertContains('<option value="pm" selected="selected">pm</option>', $result);
|
||||
$this->assertStringContainsString('<option value="04" selected="selected">4</option>', $result);
|
||||
$this->assertStringContainsString('<option value="00" selected="selected">00</option>', $result);
|
||||
$this->assertStringContainsString('<option value="pm" selected="selected">pm</option>', $result);
|
||||
|
||||
$result = $this->Form->input('Model.start_time', array(
|
||||
'timeFormat' => 24,
|
||||
|
@ -2990,8 +2990,8 @@ class FormHelperTest extends CakeTestCase {
|
|||
'interval' => 15,
|
||||
'selected' => '15:57'
|
||||
));
|
||||
$this->assertContains('<option value="16" selected="selected">16</option>', $result);
|
||||
$this->assertContains('<option value="00" selected="selected">00</option>', $result);
|
||||
$this->assertStringContainsString('<option value="16" selected="selected">16</option>', $result);
|
||||
$this->assertStringContainsString('<option value="00" selected="selected">00</option>', $result);
|
||||
|
||||
$result = $this->Form->input('Model.start_time', array(
|
||||
'timeFormat' => 24,
|
||||
|
@ -2999,8 +2999,8 @@ class FormHelperTest extends CakeTestCase {
|
|||
'interval' => 15,
|
||||
'selected' => '23:57'
|
||||
));
|
||||
$this->assertContains('<option value="00" selected="selected">0</option>', $result);
|
||||
$this->assertContains('<option value="00" selected="selected">00</option>', $result);
|
||||
$this->assertStringContainsString('<option value="00" selected="selected">0</option>', $result);
|
||||
$this->assertStringContainsString('<option value="00" selected="selected">00</option>', $result);
|
||||
|
||||
$result = $this->Form->input('Model.created', array(
|
||||
'timeFormat' => 24,
|
||||
|
@ -3008,11 +3008,11 @@ class FormHelperTest extends CakeTestCase {
|
|||
'interval' => 15,
|
||||
'selected' => '2012-09-30 23:56'
|
||||
));
|
||||
$this->assertContains('<option value="2012" selected="selected">2012</option>', $result);
|
||||
$this->assertContains('<option value="10" selected="selected">October</option>', $result);
|
||||
$this->assertContains('<option value="01" selected="selected">1</option>', $result);
|
||||
$this->assertContains('<option value="00" selected="selected">0</option>', $result);
|
||||
$this->assertContains('<option value="00" selected="selected">00</option>', $result);
|
||||
$this->assertStringContainsString('<option value="2012" selected="selected">2012</option>', $result);
|
||||
$this->assertStringContainsString('<option value="10" selected="selected">October</option>', $result);
|
||||
$this->assertStringContainsString('<option value="01" selected="selected">1</option>', $result);
|
||||
$this->assertStringContainsString('<option value="00" selected="selected">0</option>', $result);
|
||||
$this->assertStringContainsString('<option value="00" selected="selected">00</option>', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3026,18 +3026,18 @@ class FormHelperTest extends CakeTestCase {
|
|||
'interval' => 15,
|
||||
'value' => array('hour' => '3', 'min' => '57', 'meridian' => 'pm')
|
||||
));
|
||||
$this->assertContains('<option value="04" selected="selected">4</option>', $result);
|
||||
$this->assertContains('<option value="00" selected="selected">00</option>', $result);
|
||||
$this->assertContains('<option value="pm" selected="selected">pm</option>', $result);
|
||||
$this->assertStringContainsString('<option value="04" selected="selected">4</option>', $result);
|
||||
$this->assertStringContainsString('<option value="00" selected="selected">00</option>', $result);
|
||||
$this->assertStringContainsString('<option value="pm" selected="selected">pm</option>', $result);
|
||||
|
||||
$result = $this->Form->input('Model.start_time', array(
|
||||
'type' => 'time',
|
||||
'interval' => 15,
|
||||
'value' => '2012-10-23 15:57:00'
|
||||
));
|
||||
$this->assertContains('<option value="04" selected="selected">4</option>', $result);
|
||||
$this->assertContains('<option value="00" selected="selected">00</option>', $result);
|
||||
$this->assertContains('<option value="pm" selected="selected">pm</option>', $result);
|
||||
$this->assertStringContainsString('<option value="04" selected="selected">4</option>', $result);
|
||||
$this->assertStringContainsString('<option value="00" selected="selected">00</option>', $result);
|
||||
$this->assertStringContainsString('<option value="pm" selected="selected">pm</option>', $result);
|
||||
|
||||
$result = $this->Form->input('Model.start_time', array(
|
||||
'timeFormat' => 24,
|
||||
|
@ -3045,8 +3045,8 @@ class FormHelperTest extends CakeTestCase {
|
|||
'interval' => 15,
|
||||
'value' => '15:57'
|
||||
));
|
||||
$this->assertContains('<option value="16" selected="selected">16</option>', $result);
|
||||
$this->assertContains('<option value="00" selected="selected">00</option>', $result);
|
||||
$this->assertStringContainsString('<option value="16" selected="selected">16</option>', $result);
|
||||
$this->assertStringContainsString('<option value="00" selected="selected">00</option>', $result);
|
||||
|
||||
$result = $this->Form->input('Model.start_time', array(
|
||||
'timeFormat' => 24,
|
||||
|
@ -3054,8 +3054,8 @@ class FormHelperTest extends CakeTestCase {
|
|||
'interval' => 15,
|
||||
'value' => '23:57'
|
||||
));
|
||||
$this->assertContains('<option value="00" selected="selected">0</option>', $result);
|
||||
$this->assertContains('<option value="00" selected="selected">00</option>', $result);
|
||||
$this->assertStringContainsString('<option value="00" selected="selected">0</option>', $result);
|
||||
$this->assertStringContainsString('<option value="00" selected="selected">00</option>', $result);
|
||||
|
||||
$result = $this->Form->input('Model.created', array(
|
||||
'timeFormat' => 24,
|
||||
|
@ -3063,11 +3063,11 @@ class FormHelperTest extends CakeTestCase {
|
|||
'interval' => 15,
|
||||
'value' => '2012-09-30 23:56'
|
||||
));
|
||||
$this->assertContains('<option value="2012" selected="selected">2012</option>', $result);
|
||||
$this->assertContains('<option value="10" selected="selected">October</option>', $result);
|
||||
$this->assertContains('<option value="01" selected="selected">1</option>', $result);
|
||||
$this->assertContains('<option value="00" selected="selected">0</option>', $result);
|
||||
$this->assertContains('<option value="00" selected="selected">00</option>', $result);
|
||||
$this->assertStringContainsString('<option value="2012" selected="selected">2012</option>', $result);
|
||||
$this->assertStringContainsString('<option value="10" selected="selected">October</option>', $result);
|
||||
$this->assertStringContainsString('<option value="01" selected="selected">1</option>', $result);
|
||||
$this->assertStringContainsString('<option value="00" selected="selected">0</option>', $result);
|
||||
$this->assertStringContainsString('<option value="00" selected="selected">00</option>', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3082,9 +3082,9 @@ class FormHelperTest extends CakeTestCase {
|
|||
'interval' => 15,
|
||||
'selected' => '00:00:00'
|
||||
));
|
||||
$this->assertContains('<option value="12" selected="selected">12</option>', $result);
|
||||
$this->assertContains('<option value="00" selected="selected">00</option>', $result);
|
||||
$this->assertContains('<option value="am" selected="selected">am</option>', $result);
|
||||
$this->assertStringContainsString('<option value="12" selected="selected">12</option>', $result);
|
||||
$this->assertStringContainsString('<option value="00" selected="selected">00</option>', $result);
|
||||
$this->assertStringContainsString('<option value="am" selected="selected">am</option>', $result);
|
||||
|
||||
$result = $this->Form->input('Model.start_time', array(
|
||||
'type' => 'time',
|
||||
|
@ -3092,9 +3092,9 @@ class FormHelperTest extends CakeTestCase {
|
|||
'interval' => 15,
|
||||
'selected' => '12:00:00'
|
||||
));
|
||||
$this->assertContains('<option value="12" selected="selected">12</option>', $result);
|
||||
$this->assertContains('<option value="00" selected="selected">00</option>', $result);
|
||||
$this->assertContains('<option value="pm" selected="selected">pm</option>', $result);
|
||||
$this->assertStringContainsString('<option value="12" selected="selected">12</option>', $result);
|
||||
$this->assertStringContainsString('<option value="00" selected="selected">00</option>', $result);
|
||||
$this->assertStringContainsString('<option value="pm" selected="selected">pm</option>', $result);
|
||||
|
||||
$result = $this->Form->input('Model.start_time', array(
|
||||
'type' => 'time',
|
||||
|
@ -3102,9 +3102,9 @@ class FormHelperTest extends CakeTestCase {
|
|||
'interval' => 15,
|
||||
'selected' => '12:15:00'
|
||||
));
|
||||
$this->assertContains('<option value="12" selected="selected">12</option>', $result);
|
||||
$this->assertContains('<option value="15" selected="selected">15</option>', $result);
|
||||
$this->assertContains('<option value="pm" selected="selected">pm</option>', $result);
|
||||
$this->assertStringContainsString('<option value="12" selected="selected">12</option>', $result);
|
||||
$this->assertStringContainsString('<option value="15" selected="selected">15</option>', $result);
|
||||
$this->assertStringContainsString('<option value="pm" selected="selected">pm</option>', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3119,9 +3119,9 @@ class FormHelperTest extends CakeTestCase {
|
|||
'interval' => 15,
|
||||
'value' => '00:00:00'
|
||||
));
|
||||
$this->assertContains('<option value="12" selected="selected">12</option>', $result);
|
||||
$this->assertContains('<option value="00" selected="selected">00</option>', $result);
|
||||
$this->assertContains('<option value="am" selected="selected">am</option>', $result);
|
||||
$this->assertStringContainsString('<option value="12" selected="selected">12</option>', $result);
|
||||
$this->assertStringContainsString('<option value="00" selected="selected">00</option>', $result);
|
||||
$this->assertStringContainsString('<option value="am" selected="selected">am</option>', $result);
|
||||
|
||||
$result = $this->Form->input('Model.start_time', array(
|
||||
'type' => 'time',
|
||||
|
@ -3129,9 +3129,9 @@ class FormHelperTest extends CakeTestCase {
|
|||
'interval' => 15,
|
||||
'value' => '12:00:00'
|
||||
));
|
||||
$this->assertContains('<option value="12" selected="selected">12</option>', $result);
|
||||
$this->assertContains('<option value="00" selected="selected">00</option>', $result);
|
||||
$this->assertContains('<option value="pm" selected="selected">pm</option>', $result);
|
||||
$this->assertStringContainsString('<option value="12" selected="selected">12</option>', $result);
|
||||
$this->assertStringContainsString('<option value="00" selected="selected">00</option>', $result);
|
||||
$this->assertStringContainsString('<option value="pm" selected="selected">pm</option>', $result);
|
||||
|
||||
$result = $this->Form->input('Model.start_time', array(
|
||||
'type' => 'time',
|
||||
|
@ -3139,9 +3139,9 @@ class FormHelperTest extends CakeTestCase {
|
|||
'interval' => 15,
|
||||
'value' => '12:15:00'
|
||||
));
|
||||
$this->assertContains('<option value="12" selected="selected">12</option>', $result);
|
||||
$this->assertContains('<option value="15" selected="selected">15</option>', $result);
|
||||
$this->assertContains('<option value="pm" selected="selected">pm</option>', $result);
|
||||
$this->assertStringContainsString('<option value="12" selected="selected">12</option>', $result);
|
||||
$this->assertStringContainsString('<option value="15" selected="selected">15</option>', $result);
|
||||
$this->assertStringContainsString('<option value="pm" selected="selected">pm</option>', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3156,9 +3156,9 @@ class FormHelperTest extends CakeTestCase {
|
|||
'interval' => 5,
|
||||
'selected' => array('hour' => '4', 'min' => '30', 'meridian' => 'pm')
|
||||
));
|
||||
$this->assertContains('<option value="04" selected="selected">4</option>', $result);
|
||||
$this->assertContains('<option value="30" selected="selected">30</option>', $result);
|
||||
$this->assertContains('<option value="pm" selected="selected">pm</option>', $result);
|
||||
$this->assertStringContainsString('<option value="04" selected="selected">4</option>', $result);
|
||||
$this->assertStringContainsString('<option value="30" selected="selected">30</option>', $result);
|
||||
$this->assertStringContainsString('<option value="pm" selected="selected">pm</option>', $result);
|
||||
|
||||
$result = $this->Form->input('Model.start_time', array(
|
||||
'type' => 'time',
|
||||
|
@ -3166,9 +3166,9 @@ class FormHelperTest extends CakeTestCase {
|
|||
'interval' => 5,
|
||||
'selected' => '2013-04-19 16:30:00'
|
||||
));
|
||||
$this->assertContains('<option value="04" selected="selected">4</option>', $result);
|
||||
$this->assertContains('<option value="30" selected="selected">30</option>', $result);
|
||||
$this->assertContains('<option value="pm" selected="selected">pm</option>', $result);
|
||||
$this->assertStringContainsString('<option value="04" selected="selected">4</option>', $result);
|
||||
$this->assertStringContainsString('<option value="30" selected="selected">30</option>', $result);
|
||||
$this->assertStringContainsString('<option value="pm" selected="selected">pm</option>', $result);
|
||||
|
||||
$result = $this->Form->input('Model.start_time', array(
|
||||
'type' => 'time',
|
||||
|
@ -3176,9 +3176,9 @@ class FormHelperTest extends CakeTestCase {
|
|||
'interval' => 10,
|
||||
'selected' => '2013-05-19 00:33:00'
|
||||
));
|
||||
$this->assertContains('<option value="12" selected="selected">12</option>', $result);
|
||||
$this->assertContains('<option value="30" selected="selected">30</option>', $result);
|
||||
$this->assertContains('<option value="am" selected="selected">am</option>', $result);
|
||||
$this->assertStringContainsString('<option value="12" selected="selected">12</option>', $result);
|
||||
$this->assertStringContainsString('<option value="30" selected="selected">30</option>', $result);
|
||||
$this->assertStringContainsString('<option value="am" selected="selected">am</option>', $result);
|
||||
|
||||
$result = $this->Form->input('Model.start_time', array(
|
||||
'type' => 'time',
|
||||
|
@ -3186,9 +3186,9 @@ class FormHelperTest extends CakeTestCase {
|
|||
'interval' => 10,
|
||||
'selected' => '2013-05-19 13:33:00'
|
||||
));
|
||||
$this->assertContains('<option value="01" selected="selected">1</option>', $result);
|
||||
$this->assertContains('<option value="30" selected="selected">30</option>', $result);
|
||||
$this->assertContains('<option value="pm" selected="selected">pm</option>', $result);
|
||||
$this->assertStringContainsString('<option value="01" selected="selected">1</option>', $result);
|
||||
$this->assertStringContainsString('<option value="30" selected="selected">30</option>', $result);
|
||||
$this->assertStringContainsString('<option value="pm" selected="selected">pm</option>', $result);
|
||||
|
||||
$result = $this->Form->input('Model.start_time', array(
|
||||
'type' => 'time',
|
||||
|
@ -3196,9 +3196,9 @@ class FormHelperTest extends CakeTestCase {
|
|||
'interval' => 10,
|
||||
'selected' => '2013-05-19 01:33:00'
|
||||
));
|
||||
$this->assertContains('<option value="01" selected="selected">1</option>', $result);
|
||||
$this->assertContains('<option value="30" selected="selected">30</option>', $result);
|
||||
$this->assertContains('<option value="am" selected="selected">am</option>', $result);
|
||||
$this->assertStringContainsString('<option value="01" selected="selected">1</option>', $result);
|
||||
$this->assertStringContainsString('<option value="30" selected="selected">30</option>', $result);
|
||||
$this->assertStringContainsString('<option value="am" selected="selected">am</option>', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4027,9 +4027,9 @@ class FormHelperTest extends CakeTestCase {
|
|||
$this->Form->create('TestPlugin.TestPluginPost');
|
||||
$result = $this->Form->inputs();
|
||||
|
||||
$this->assertContains('data[TestPluginPost][id]', $result);
|
||||
$this->assertContains('data[TestPluginPost][author_id]', $result);
|
||||
$this->assertContains('data[TestPluginPost][title]', $result);
|
||||
$this->assertStringContainsString('data[TestPluginPost][id]', $result);
|
||||
$this->assertStringContainsString('data[TestPluginPost][author_id]', $result);
|
||||
$this->assertStringContainsString('data[TestPluginPost][title]', $result);
|
||||
$this->assertTrue(ClassRegistry::isKeySet('TestPluginPost'));
|
||||
$this->assertFalse(ClassRegistry::isKeySet('TestPlugin'));
|
||||
$this->assertEquals('TestPluginPost', $this->Form->model());
|
||||
|
@ -7474,13 +7474,13 @@ class FormHelperTest extends CakeTestCase {
|
|||
*/
|
||||
public function testDateTimeLabelIdMatchesFirstInput() {
|
||||
$result = $this->Form->input('Model.date', array('type' => 'date'));
|
||||
$this->assertContains('label for="ModelDateMonth"', $result);
|
||||
$this->assertStringContainsString('label for="ModelDateMonth"', $result);
|
||||
|
||||
$result = $this->Form->input('Model.date', array('type' => 'date', 'dateFormat' => 'DMY'));
|
||||
$this->assertContains('label for="ModelDateDay"', $result);
|
||||
$this->assertStringContainsString('label for="ModelDateDay"', $result);
|
||||
|
||||
$result = $this->Form->input('Model.date', array('type' => 'date', 'dateFormat' => 'YMD'));
|
||||
$this->assertContains('label for="ModelDateYear"', $result);
|
||||
$this->assertStringContainsString('label for="ModelDateYear"', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -7870,10 +7870,10 @@ class FormHelperTest extends CakeTestCase {
|
|||
|
||||
$this->Form->request->data['Model']['field'] = '';
|
||||
$result = $this->Form->hour('Model.field', true, array('value' => '23'));
|
||||
$this->assertContains('<option value="23" selected="selected">23</option>', $result);
|
||||
$this->assertStringContainsString('<option value="23" selected="selected">23</option>', $result);
|
||||
|
||||
$result = $this->Form->hour('Model.field', false, array('value' => '23'));
|
||||
$this->assertContains('<option value="11" selected="selected">11</option>', $result);
|
||||
$this->assertStringContainsString('<option value="11" selected="selected">11</option>', $result);
|
||||
|
||||
$this->Form->request->data['Model']['field'] = '2006-10-10 00:12:32';
|
||||
$result = $this->Form->hour('Model.field', true);
|
||||
|
@ -8118,7 +8118,7 @@ class FormHelperTest extends CakeTestCase {
|
|||
$this->assertTags($result, $expected);
|
||||
|
||||
$result = $this->Form->year('published', array(), array(), array('empty' => false));
|
||||
$this->assertContains('data[Contact][published][year]', $result);
|
||||
$this->assertStringContainsString('data[Contact][published][year]', $result);
|
||||
|
||||
$this->Form->request->data['Contact']['published'] = '2014ee';
|
||||
$result = $this->Form->year('Contact.published', 2010, 2011);
|
||||
|
@ -8197,7 +8197,7 @@ class FormHelperTest extends CakeTestCase {
|
|||
'maxYear' => 2008
|
||||
)
|
||||
);
|
||||
$this->assertContains('value="' . date('m') . '" selected="selected"', $result);
|
||||
$this->assertStringContainsString('value="' . date('m') . '" selected="selected"', $result);
|
||||
$this->assertNotContains('value="2008" selected="selected"', $result);
|
||||
|
||||
$result = $this->Form->input('just_year',
|
||||
|
@ -8249,7 +8249,7 @@ class FormHelperTest extends CakeTestCase {
|
|||
'class' => 'form-control'
|
||||
)
|
||||
);
|
||||
$this->assertContains('class="form-control"', $result);
|
||||
$this->assertStringContainsString('class="form-control"', $result);
|
||||
|
||||
$result = $this->Form->input('date',
|
||||
array(
|
||||
|
@ -8258,7 +8258,7 @@ class FormHelperTest extends CakeTestCase {
|
|||
'class' => 'form-control'
|
||||
)
|
||||
);
|
||||
$this->assertContains('class="form-control"', $result);
|
||||
$this->assertStringContainsString('class="form-control"', $result);
|
||||
|
||||
$result = $this->Form->input('date',
|
||||
array(
|
||||
|
@ -8267,7 +8267,7 @@ class FormHelperTest extends CakeTestCase {
|
|||
'class' => 'form-control'
|
||||
)
|
||||
);
|
||||
$this->assertContains('class="form-control"', $result);
|
||||
$this->assertStringContainsString('class="form-control"', $result);
|
||||
|
||||
$result = $this->Form->input('date',
|
||||
array(
|
||||
|
@ -8276,7 +8276,7 @@ class FormHelperTest extends CakeTestCase {
|
|||
'class' => 'form-control'
|
||||
)
|
||||
);
|
||||
$this->assertContains('class="form-control"', $result);
|
||||
$this->assertStringContainsString('class="form-control"', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -8300,7 +8300,7 @@ class FormHelperTest extends CakeTestCase {
|
|||
'maxYear' => 2008
|
||||
)
|
||||
);
|
||||
$this->assertContains('value="2008" selected="selected"', $result);
|
||||
$this->assertStringContainsString('value="2008" selected="selected"', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -8559,9 +8559,9 @@ class FormHelperTest extends CakeTestCase {
|
|||
)
|
||||
);
|
||||
$result = $this->Form->postButton('Send', '/', array('data' => $data));
|
||||
$this->assertContains('<input type="hidden" name="data[one][two][0]" value="3"', $result);
|
||||
$this->assertContains('<input type="hidden" name="data[one][two][1]" value="4"', $result);
|
||||
$this->assertContains('<input type="hidden" name="data[one][two][2]" value="5"', $result);
|
||||
$this->assertStringContainsString('<input type="hidden" name="data[one][two][0]" value="3"', $result);
|
||||
$this->assertStringContainsString('<input type="hidden" name="data[one][two][1]" value="4"', $result);
|
||||
$this->assertStringContainsString('<input type="hidden" name="data[one][two][2]" value="5"', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -8662,7 +8662,7 @@ class FormHelperTest extends CakeTestCase {
|
|||
));
|
||||
|
||||
$result = $this->Form->postLink('Delete', '/posts/delete', array('data' => array('id' => 1)));
|
||||
$this->assertContains('<input type="hidden" name="data[id]" value="1"/>', $result);
|
||||
$this->assertStringContainsString('<input type="hidden" name="data[id]" value="1"/>', $result);
|
||||
|
||||
$result = $this->Form->postLink('Delete', '/posts/delete/1', array('target' => '_blank'));
|
||||
$this->assertTags($result, array(
|
||||
|
@ -8764,7 +8764,7 @@ class FormHelperTest extends CakeTestCase {
|
|||
$result = $this->View->fetch('postLink');
|
||||
|
||||
$this->assertEquals(array('Post.title'), $this->Form->fields);
|
||||
$this->assertContains($hash, $result, 'Should contain the correct hash.');
|
||||
$this->assertStringContainsString($hash, $result, 'Should contain the correct hash.');
|
||||
$this->assertAttributeEquals(
|
||||
'/basedir/posts/add',
|
||||
'_lastAction',
|
||||
|
@ -8786,9 +8786,9 @@ class FormHelperTest extends CakeTestCase {
|
|||
)
|
||||
);
|
||||
$result = $this->Form->postLink('Send', '/', array('data' => $data));
|
||||
$this->assertContains('<input type="hidden" name="data[one][two][0]" value="3"', $result);
|
||||
$this->assertContains('<input type="hidden" name="data[one][two][1]" value="4"', $result);
|
||||
$this->assertContains('<input type="hidden" name="data[one][two][2]" value="5"', $result);
|
||||
$this->assertStringContainsString('<input type="hidden" name="data[one][two][0]" value="3"', $result);
|
||||
$this->assertStringContainsString('<input type="hidden" name="data[one][two][1]" value="4"', $result);
|
||||
$this->assertStringContainsString('<input type="hidden" name="data[one][two][2]" value="5"', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -320,14 +320,14 @@ class ScaffoldViewTest extends CakeTestCase {
|
|||
$this->Controller->response->send();
|
||||
$result = ob_get_clean();
|
||||
|
||||
$this->assertContains('<form action="/scaffold_mock/edit/1" id="ScaffoldMockEditForm" method="post"', $result);
|
||||
$this->assertContains('<legend>Edit Scaffold Mock</legend>', $result);
|
||||
$this->assertStringContainsString('<form action="/scaffold_mock/edit/1" id="ScaffoldMockEditForm" method="post"', $result);
|
||||
$this->assertStringContainsString('<legend>Edit Scaffold Mock</legend>', $result);
|
||||
|
||||
$this->assertContains('input type="hidden" name="data[ScaffoldMock][id]" value="1" id="ScaffoldMockId"', $result);
|
||||
$this->assertContains('select name="data[ScaffoldMock][user_id]" id="ScaffoldMockUserId"', $result);
|
||||
$this->assertContains('input name="data[ScaffoldMock][title]" maxlength="255" type="text" value="First Article" id="ScaffoldMockTitle"', $result);
|
||||
$this->assertContains('input name="data[ScaffoldMock][published]" maxlength="1" type="text" value="Y" id="ScaffoldMockPublished"', $result);
|
||||
$this->assertContains('textarea name="data[ScaffoldMock][body]" cols="30" rows="6" id="ScaffoldMockBody"', $result);
|
||||
$this->assertStringContainsString('input type="hidden" name="data[ScaffoldMock][id]" value="1" id="ScaffoldMockId"', $result);
|
||||
$this->assertStringContainsString('select name="data[ScaffoldMock][user_id]" id="ScaffoldMockUserId"', $result);
|
||||
$this->assertStringContainsString('input name="data[ScaffoldMock][title]" maxlength="255" type="text" value="First Article" id="ScaffoldMockTitle"', $result);
|
||||
$this->assertStringContainsString('input name="data[ScaffoldMock][published]" maxlength="1" type="text" value="Y" id="ScaffoldMockPublished"', $result);
|
||||
$this->assertStringContainsString('textarea name="data[ScaffoldMock][body]" cols="30" rows="6" id="ScaffoldMockBody"', $result);
|
||||
$this->assertMatchesRegularExpression('/<a href="\#" onclick="if[^>]*>Delete<\/a><\/li>/', $result);
|
||||
}
|
||||
|
||||
|
|
|
@ -215,7 +215,7 @@ class ThemeViewTest extends CakeTestCase {
|
|||
$View->getViewFileName('does_not_exist');
|
||||
$this->fail('No exception');
|
||||
} catch (MissingViewException $e) {
|
||||
$this->assertContains('Pages' . DS . 'does_not_exist.ctp', $e->getMessage());
|
||||
$this->assertStringContainsString('Pages' . DS . 'does_not_exist.ctp', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -237,7 +237,7 @@ class ThemeViewTest extends CakeTestCase {
|
|||
$View->getLayoutFileName();
|
||||
$this->fail('No exception');
|
||||
} catch (MissingLayoutException $e) {
|
||||
$this->assertContains('Layouts' . DS . 'whatever.ctp', $e->getMessage());
|
||||
$this->assertStringContainsString('Layouts' . DS . 'whatever.ctp', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1668,7 +1668,7 @@ class ViewTest extends CakeTestCase {
|
|||
$this->fail('No exception');
|
||||
} catch (CakeException $e) {
|
||||
ob_end_clean();
|
||||
$this->assertContains('The "no_close" block was left open', $e->getMessage());
|
||||
$this->assertStringContainsString('The "no_close" block was left open', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1701,7 +1701,7 @@ TEXT;
|
|||
$this->fail('No exception');
|
||||
} catch (LogicException $e) {
|
||||
ob_end_clean();
|
||||
$this->assertContains('cannot have views extend themselves', $e->getMessage());
|
||||
$this->assertStringContainsString('cannot have views extend themselves', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1717,7 +1717,7 @@ TEXT;
|
|||
$this->fail('No exception');
|
||||
} catch (LogicException $e) {
|
||||
ob_end_clean();
|
||||
$this->assertContains('cannot have views extend in a loop', $e->getMessage());
|
||||
$this->assertStringContainsString('cannot have views extend in a loop', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1752,7 +1752,7 @@ TEXT;
|
|||
} catch (LogicException $e) {
|
||||
ob_end_clean();
|
||||
ob_end_clean();
|
||||
$this->assertContains('element', $e->getMessage());
|
||||
$this->assertStringContainsString('element', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue