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


PHP Rectangle::getElementName方法代码示例

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


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

示例1: testParseFalseRectangle

 public function testParseFalseRectangle()
 {
     $badrectanglecoord = '10°10°10", 10°10\'10"';
     $this->assertEquals(\FormatJson::encode($this->object->getMapData(array(' ', 'rectangles  =51.83577752045248  ,33.837890625 : 46.37725420510028 ,23.37890625 ', "rectangle={$badrectanglecoord}: 40, 40", 'service=leaflet'))), '{"rectangles":[{"pos":[{"lat":51.835777520452,"lon":33.837890625},{"lat":46.3772542051,"lon":23.37890625}]}],"bounds":{"ne":{"lat":51.835777520452,"lon":33.837890625},"sw":{"lat":46.3772542051,"lon":23.37890625}}}');
     $rectangle = new Rectangle();
     $this->assertEquals($this->object->getErrorMessages(), array(\wfMessage('multimaps-unable-parse-coordinates', $badrectanglecoord)->escaped(), \wfMessage('multimaps-unable-create-element', $rectangle->getElementName())->escaped()));
     $this->assertEquals(\FormatJson::encode($this->object->getMapData(array('; ', 'rectangles  =51.83577752045248  ,33.837890625 : 46.37725420510028 ,23.37890625 ', "rectangle=40, 40:{$badrectanglecoord}", 'service=leaflet'))), '{"rectangles":[{"pos":[{"lat":51.835777520452,"lon":33.837890625},{"lat":46.3772542051,"lon":23.37890625}]}],"bounds":{"ne":{"lat":51.835777520452,"lon":33.837890625},"sw":{"lat":46.3772542051,"lon":23.37890625}}}');
     $this->assertEquals($this->object->getErrorMessages(), array(\wfMessage('multimaps-unable-parse-coordinates', $badrectanglecoord)->escaped(), \wfMessage('multimaps-unable-create-element', $rectangle->getElementName())->escaped()));
     $this->assertEquals(\FormatJson::encode($this->object->getMapData(array('rectangles  =51.83577752045248  ,33.837890625 : 46.37725420510028 ,23.37890625 ', "rectangle=40, 40 : {$badrectanglecoord} : 20,20", 'service=leaflet'))), '{"rectangles":[{"pos":[{"lat":51.835777520452,"lon":33.837890625},{"lat":46.3772542051,"lon":23.37890625}]}],"bounds":{"ne":{"lat":51.835777520452,"lon":33.837890625},"sw":{"lat":46.3772542051,"lon":23.37890625}}}');
     $this->assertEquals($this->object->getErrorMessages(), array(\wfMessage('multimaps-square-wrong-number-points', 3)->escaped(), \wfMessage('multimaps-unable-create-element', $rectangle->getElementName())->escaped()));
 }
开发者ID:MapsMD,项目名称:mediawikiMaps,代码行数:11,代码来源:LeafletTest.php

示例2: testParseCoordinates

 /**
  * @covers MultiMaps\Rectangle::getElementName
  */
 public function testParseCoordinates()
 {
     $this->assertEquals($this->object->getElementName(), 'Rectangle');
 }
开发者ID:MapsMD,项目名称:mediawikiMaps,代码行数:7,代码来源:RectangleTest.php


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