本文整理汇总了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()));
}
示例2: testParseCoordinates
/**
* @covers MultiMaps\Rectangle::getElementName
*/
public function testParseCoordinates()
{
$this->assertEquals($this->object->getElementName(), 'Rectangle');
}