当前位置: 首页>>代码示例>>PHP>>正文


PHP SiteTree::validURLSegment方法代码示例

本文整理汇总了PHP中SiteTree::validURLSegment方法的典型用法代码示例。如果您正苦于以下问题:PHP SiteTree::validURLSegment方法的具体用法?PHP SiteTree::validURLSegment怎么用?PHP SiteTree::validURLSegment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SiteTree的用法示例。


在下文中一共展示了SiteTree::validURLSegment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testURLSegmentPrioritizesExtensionVotes

 public function testURLSegmentPrioritizesExtensionVotes()
 {
     $sitetree = new SiteTree();
     $sitetree->URLSegment = 'unique-segment';
     $this->assertTrue($sitetree->validURLSegment());
     SiteTree::add_extension('SiteTreeTest_Extension');
     $sitetree = new SiteTree();
     $sitetree->URLSegment = 'unique-segment';
     $this->assertFalse($sitetree->validURLSegment());
     SiteTree::remove_extension('SiteTreeTest_Extension');
 }
开发者ID:fanggu,项目名称:loveyourwater_ss_v3.1.6,代码行数:11,代码来源:SiteTreeTest.php

示例2: testValidURLSegmentControllerConflicts

 /**
  * @covers SiteTree::validURLSegment
  */
 public function testValidURLSegmentControllerConflicts()
 {
     SiteTree::enable_nested_urls();
     $sitetree = new SiteTree();
     $sitetree->ParentID = $this->idFromFixture('SiteTreeTest_Conflicted', 'parent');
     $sitetree->URLSegment = 'index';
     $this->assertFalse($sitetree->validURLSegment(), 'index is not a valid URLSegment');
     $sitetree->URLSegment = 'conflicted-action';
     $this->assertFalse($sitetree->validURLSegment(), 'allowed_actions conflicts are recognised');
     $sitetree->URLSegment = 'conflicted-template';
     $this->assertFalse($sitetree->validURLSegment(), 'Action-specific template conflicts are recognised');
     $sitetree->URLSegment = 'valid';
     $this->assertTrue($sitetree->validURLSegment(), 'Valid URLSegment values are allowed');
 }
开发者ID:comperio,项目名称:silverstripe-framework,代码行数:17,代码来源:SiteTreeTest.php


注:本文中的SiteTree::validURLSegment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。