本文整理汇总了PHP中Deprecation::notification_version方法的典型用法代码示例。如果您正苦于以下问题:PHP Deprecation::notification_version方法的具体用法?PHP Deprecation::notification_version怎么用?PHP Deprecation::notification_version使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Deprecation
的用法示例。
在下文中一共展示了Deprecation::notification_version方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
parent::setUp();
// This test tests code that was deprecated after 2.4
$this->originalDeprecation = Deprecation::dump_settings();
Deprecation::notification_version('2.4');
}
示例2: testGetArray
public function testGetArray()
{
$originalDeprecation = Deprecation::dump_settings();
Deprecation::notification_version('2.4');
$array = array('Foo' => 'Foo', 'Bar' => 'Bar', 'Baz' => 'Baz');
$arrayData = new ArrayData($array);
$this->assertEquals($arrayData->toMap(), $array);
Deprecation::restore_settings($originalDeprecation);
}
示例3: testGroupMap
/**
* Test the Group::map() function
*/
public function testGroupMap()
{
// 2.4 only
$originalDeprecation = Deprecation::dump_settings();
Deprecation::notification_version('2.4');
/* Group::map() returns an SQLMap object implementing iterator. You can use foreach to get ID-Title pairs. */
// We will iterate over the map and build mapOuput to more easily call assertions on the result.
$map = Group::map();
$mapOutput = $map->toArray();
$group1 = $this->objFromFixture('Group', 'group1');
$group2 = $this->objFromFixture('Group', 'group2');
/* We have added 2 groups to our fixture. They should both appear in $mapOutput. */
$this->assertEquals($mapOutput[$group1->ID], $group1->Title);
$this->assertEquals($mapOutput[$group2->ID], $group2->Title);
Deprecation::restore_settings($originalDeprecation);
}
示例4: testRewriteTabPathFindOrMakeTab
public function testRewriteTabPathFindOrMakeTab()
{
$originalDeprecation = Deprecation::dump_settings();
Deprecation::notification_version('2.4');
$fields = new FieldList(new Tabset("Root", $tab1Level1 = new Tab("Tab1Level1Renamed", $tab1Level2 = new Tab("Tab1Level2"), $tab2Level2 = new Tab("Tab2Level2")), $tab2Level1 = new Tab("Tab2Level1")));
$fields->setTabPathRewrites(array('/Root\\.Tab1Level1\\.([^.]+)$/' => 'Root.Tab1Level1Renamed.\\1', '/Root\\.Tab1Level1$/' => 'Root.Tab1Level1Renamed'));
$this->assertEquals($tab1Level1, $fields->findOrMakeTab('Root.Tab1Level1'), 'findOrMakeTab() with toplevel tab under old name');
$this->assertEquals($tab1Level1, $fields->findOrMakeTab('Root.Tab1Level1Renamed'), 'findOrMakeTab() with toplevel tab under new name');
$this->assertEquals($tab1Level2, $fields->findOrMakeTab('Root.Tab1Level1.Tab1Level2'), 'findOrMakeTab() with nested tab under old parent tab name');
$this->assertEquals($tab1Level2, $fields->findOrMakeTab('Root.Tab1Level1Renamed.Tab1Level2'), 'findOrMakeTab() with nested tab under new parent tab name');
Deprecation::restore_settings($originalDeprecation);
}
示例5: dirname
<?php
Deprecation::notification_version('1.0', 'retinaimages');
define('RETINA_MODULE_DIR', dirname(__FILE__));
Object::useCustomClass('Image', 'RetinaImage');
Object::useCustomClass('Image_Cached', 'RetinaImage_Cached');
// SiteTree uses new HtmlEditorField() instead of HtmlEditorField::create()
// as a result if you want retina images in your WYSIWYG editor you'll need to
// recreate the HtmlEditorField.
Object::useCustomClass('HtmlEditorField', 'RetinaImageHtmlEditorField');
// tinyCMS additional HTML5 elements
$wysiwyg = HtmlEditorConfig::get('cms')->getOption('valid_elements');
$wysiwyg .= ',-img[id|dir|longdesc|usemap|class|src|border|alt=|title|width|height|align|data*|srcset]';
HtmlEditorConfig::get('cms')->setOption('valid_elements', $wysiwyg);
示例6: testMatchingModuleNotifcationVersionAffectsNotice
/**
* @expectedException PHPUnit_Framework_Error
*/
function testMatchingModuleNotifcationVersionAffectsNotice() {
Deprecation::notification_version('1.0.0');
Deprecation::notification_version('3.0.0', FRAMEWORK_DIR);
$this->callThatOriginatesFromFramework();
}
示例7: testScopeGlobal
/**
* @expectedException PHPUnit_Framework_Error
* @expectedExceptionMessage Global scope
*/
public function testScopeGlobal()
{
Deprecation::notification_version('2.0.0');
Deprecation::notice('2.0.0', 'Global scope', Deprecation::SCOPE_GLOBAL);
}
示例8:
<?php
global $databaseConfig;
if (isset($databaseConfig['type'])) {
SearchUpdater::bind_manipulation_capture();
}
Deprecation::notification_version('1.0.0', 'fulltextsearch');
示例9:
<?php
Deprecation::notification_version('1.4.0', 'sqlite3');
示例10: testGet
/**
* Test methods that get DataObjects
* - DataObject::get()
* - All records of a DataObject
* - Filtering
* - Sorting
* - Joins
* - Limit
* - Container class
* - DataObject::get_by_id()
* - DataObject::get_one()
* - With and without caching
* - With and without ordering
*/
public function testGet()
{
// Test getting all records of a DataObject
$comments = DataObject::get('DataObjectTest_TeamComment');
$this->assertEquals(3, $comments->Count());
// Test WHERE clause
$comments = DataObject::get('DataObjectTest_TeamComment', "\"Name\"='Bob'");
$this->assertEquals(1, $comments->Count());
foreach ($comments as $comment) {
$this->assertEquals('Bob', $comment->Name);
}
// Test sorting
$comments = DataObject::get('DataObjectTest_TeamComment', '', "\"Name\" ASC");
$this->assertEquals(3, $comments->Count());
$this->assertEquals('Bob', $comments->First()->Name);
$comments = DataObject::get('DataObjectTest_TeamComment', '', "\"Name\" DESC");
$this->assertEquals(3, $comments->Count());
$this->assertEquals('Phil', $comments->First()->Name);
// Test join - 2.4 only
$originalDeprecation = Deprecation::dump_settings();
Deprecation::notification_version('2.4');
$comments = DataObject::get('DataObjectTest_TeamComment', "\"DataObjectTest_Team\".\"Title\" = 'Team 1'", "\"Name\" ASC", "INNER JOIN \"DataObjectTest_Team\"" . " ON \"DataObjectTest_TeamComment\".\"TeamID\" = \"DataObjectTest_Team\".\"ID\"");
$this->assertEquals(2, $comments->Count());
$this->assertEquals('Bob', $comments->First()->Name);
$this->assertEquals('Joe', $comments->Last()->Name);
Deprecation::restore_settings($originalDeprecation);
// Test limit
$comments = DataObject::get('DataObjectTest_TeamComment', '', "\"Name\" ASC", '', '1,2');
$this->assertEquals(2, $comments->Count());
$this->assertEquals('Joe', $comments->First()->Name);
$this->assertEquals('Phil', $comments->Last()->Name);
// Test get_by_id()
$captain1ID = $this->idFromFixture('DataObjectTest_Player', 'captain1');
$captain1 = DataObject::get_by_id('DataObjectTest_Player', $captain1ID);
$this->assertEquals('Captain', $captain1->FirstName);
// Test get_one() without caching
$comment1 = DataObject::get_one('DataObjectTest_TeamComment', "\"Name\" = 'Joe'", false);
$comment1->Comment = "Something Else";
$comment2 = DataObject::get_one('DataObjectTest_TeamComment', "\"Name\" = 'Joe'", false);
$this->assertNotEquals($comment1->Comment, $comment2->Comment);
// Test get_one() with caching
$comment1 = DataObject::get_one('DataObjectTest_TeamComment', "\"Name\" = 'Bob'", true);
$comment1->Comment = "Something Else";
$comment2 = DataObject::get_one('DataObjectTest_TeamComment', "\"Name\" = 'Bob'", true);
$this->assertEquals((string) $comment1->Comment, (string) $comment2->Comment);
// Test get_one() with order by without caching
$comment = DataObject::get_one('DataObjectTest_TeamComment', '', false, "\"Name\" ASC");
$this->assertEquals('Bob', $comment->Name);
$comment = DataObject::get_one('DataObjectTest_TeamComment', '', false, "\"Name\" DESC");
$this->assertEquals('Phil', $comment->Name);
// Test get_one() with order by with caching
$comment = DataObject::get_one('DataObjectTest_TeamComment', '', true, '"Name" ASC');
$this->assertEquals('Bob', $comment->Name);
$comment = DataObject::get_one('DataObjectTest_TeamComment', '', true, '"Name" DESC');
$this->assertEquals('Phil', $comment->Name);
}
示例11: define
<?php
if (!defined('USERFORMS_DIR')) {
define('USERFORMS_DIR', basename(__DIR__));
}
Deprecation::notification_version('3.0', 'userforms');
示例12: testDeprecatedSetDelete
/**
* Test deprecation of SQLQuery::setDelete/getDelete
*/
public function testDeprecatedSetDelete()
{
// Temporarily disable deprecation
Deprecation::notification_version(null);
$query = new SQLQuery();
$query->setSelect(array('"SQLQueryTest_DO"."Name"'));
$query->setFrom('"SQLQueryTest_DO"');
$query->setWhere(array('"SQLQueryTest_DO"."Name"' => 'Andrew'));
// Check SQL for select
$this->assertSQLEquals(<<<EOS
SELECT "SQLQueryTest_DO"."Name" FROM "SQLQueryTest_DO"
WHERE ("SQLQueryTest_DO"."Name" = ?)
EOS
, $query->sql($parameters));
$this->assertEquals(array('Andrew'), $parameters);
// Check setDelete works
$query->setDelete(true);
$this->assertSQLEquals(<<<EOS
DELETE FROM "SQLQueryTest_DO"
WHERE ("SQLQueryTest_DO"."Name" = ?)
EOS
, $query->sql($parameters));
$this->assertEquals(array('Andrew'), $parameters);
// Check that setDelete back to false restores the state
$query->setDelete(false);
$this->assertSQLEquals(<<<EOS
SELECT "SQLQueryTest_DO"."Name" FROM "SQLQueryTest_DO"
WHERE ("SQLQueryTest_DO"."Name" = ?)
EOS
, $query->sql($parameters));
$this->assertEquals(array('Andrew'), $parameters);
}
示例13:
<?php
/**
* Default configuration settings for the Spam Protection module.
*
* You should not put your own configuration in here rather use your
* mysite/_config.php file
*
* @package spamprotection
*/
Deprecation::notification_version('1.1', 'spamprotection');
示例14: SSGuru_Requirements_Backend
<?php
Requirements::set_backend(new SSGuru_Requirements_Backend());
define('SS_GDM_EXTENSIONS_DIR', basename(dirname(__FILE__)));
Deprecation::notification_version("0.1.3", SS_GDM_EXTENSIONS_DIR);
示例15: define
<?php
if (!defined('SS_MWM_DIR')) {
define('SS_MWM_DIR', basename(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR)));
}
Requirements::set_backend(new \Milkyway\SS\Core\RequirementsBackend());
// Register all shortcodes for use with injector and shortcodable module
Milkyway\SS\Shortcodes\Extensions\ShortcodableController::register();
Deprecation::notification_version('0.2', 'mwm-utilities');
/**
* Credit for following functions goes to taylorotwell (laravel/framework)
*
* @credit taylorotwell (laravel/framework)
* @licence MIT
*/
if (!function_exists('with')) {
/**
* Return the given object. Useful for chaining.
*
* @param mixed $object
* @return mixed
*/
function with($object)
{
return $object;
}
}
if (!function_exists('array_set')) {
/**
* Set an array item to a given value using "dot" notation.
*