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


PHP City::setName方法代码示例

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


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

示例1: testSetGetName

 public function testSetGetName()
 {
     $this->object->setName('city');
     $this->assertEquals('city', $this->object->getName());
     $this->object->setName('City');
     $this->assertEquals('City', $this->object->getName());
 }
开发者ID:EHER,项目名称:chegamos,代码行数:7,代码来源:CityTest.php

示例2: testShouldUpdateCurrentLocation

 public function testShouldUpdateCurrentLocation()
 {
     $currentLocation = null;
     $latitude = -23.48033;
     $longitude = -46.63459;
     $city = new City();
     $city->setName("São Paulo");
     $city->setState("SP");
     $address = new Address();
     $address->setCity($city);
     $address->setStreet("Rua Funchal");
     $address->setDistrict("Vila Olímpia");
     $api = $this->getMock("ApontadorApi", array("revgeocode"));
     $api->expects($this->once())->method("revgeocode")->with($latitude, $longitude)->will($this->returnValue($address));
     $locationController = new LocationController();
     $locationController->setApi($api);
     $locationController->disableSession();
     $locationController->update($latitude, $longitude);
     $current = $locationController->current();
     $currentLocation = new Location($current['location']);
     $this->assertNotNull($currentLocation);
     $this->assertSame("SP", $currentLocation->getAddress()->getCity()->getState());
     $this->assertSame("São Paulo", $currentLocation->getAddress()->getCity()->getName());
     $this->assertSame("Vila Olímpia", $currentLocation->getAddress()->getDistrict());
     $this->assertSame("Rua Funchal", $currentLocation->getAddress()->getStreet());
     $this->assertSame($latitude, $currentLocation->getPoint()->getLat());
     $this->assertSame($longitude, $currentLocation->getPoint()->getLng());
 }
开发者ID:EHER,项目名称:chegamos,代码行数:28,代码来源:LocationControllerTest.php

示例3: load

 public function load()
 {
     $this->populate(unserialize(Session::read('location')));
     $lat = $this->point->getLat();
     $lng = $this->point->getLng();
     if (empty($lat) || empty($lng)) {
         $city = new City();
         $city->setName("São Paulo");
         $city->setState("SP");
         $this->point->setLat(-23.48033);
         $this->point->setLng(-46.63459);
         $this->address->setCity($city);
     }
 }
开发者ID:EHER,项目名称:chegamos,代码行数:14,代码来源:Location.php


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