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


PHP Organization::setOrgName方法代码示例

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


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

示例1: testUpdateValidOrganization

 /**
  * test inserting an organization, editing it, then updating it
  */
 public function testUpdateValidOrganization()
 {
     //get the count of the number of rows in the database
     $numRows = $this->getConnection()->getRowCount("organization");
     //create a new organization and insert into mySQL
     $organization = new Organization(null, $this->VALID_ADDRESS1, $this->VALID_ADDRESS2, $this->VALID_CITY, $this->VALID_DESCRIPTION, $this->VALID_HOURS, $this->VALID_NAME, $this->VALID_PHONE, $this->VALID_STATE, $this->VALID_TYPE, $this->VALID_ZIP);
     $organization->insert($this->getPDO());
     //edit the organization and update it in mySQL
     $organization->setOrgName($this->VALID_NAME_ALT);
     $organization->update($this->getPDO());
     //grab data from SQL and ensure it matches
     $pdoOrganization = Organization::getOrganizationByOrgId($this->getPDO(), $organization->getOrgId());
     $this->assertSame($numRows + 1, $this->getConnection()->getRowCount("organization"));
     $this->assertSame($pdoOrganization->getOrgAddress1(), $this->VALID_ADDRESS1);
     $this->assertSame($pdoOrganization->getOrgAddress2(), $this->VALID_ADDRESS2);
     $this->assertSame($pdoOrganization->getOrgCity(), $this->VALID_CITY);
     $this->assertSame($pdoOrganization->getOrgDescription(), $this->VALID_DESCRIPTION);
     $this->assertSame($pdoOrganization->getOrgHours(), $this->VALID_HOURS);
     $this->assertSame($pdoOrganization->getOrgName(), $this->VALID_NAME_ALT);
     $this->assertSame($pdoOrganization->getOrgPhone(), $this->VALID_PHONE);
     $this->assertSame($pdoOrganization->getOrgState(), $this->VALID_STATE);
     $this->assertSame($pdoOrganization->getOrgType(), $this->VALID_TYPE);
     $this->assertSame($pdoOrganization->getOrgZip(), $this->VALID_ZIP);
 }
开发者ID:brbrown59,项目名称:bread-basket,代码行数:27,代码来源:organization-test.php

示例2: testValidPut

 /**
  * test putting a valid organization into the API
  */
 public function testValidPut()
 {
     //create a new organization, and insert into the database
     $organization = new Organization(null, $this->VALID_ADDRESS1, $this->VALID_ADDRESS2, $this->VALID_CITY, $this->VALID_DESCRIPTION, $this->VALID_HOURS, $this->VALID_NAME, $this->VALID_PHONE, $this->VALID_STATE, $this->VALID_TYPE, $this->VALID_ZIP);
     $organization->insert($this->getPDO());
     //update the organization
     $organization->setOrgName($this->VALID_NAME_ALT);
     //send the info to update to the API
     $response = $this->guzzle->put('https://bootcamp-coders.cnm.edu/~bbrown52/bread-basket/public_html/php/api/organization/' . $organization->getOrgId(), ['allow-redirects' => ['strict' => true], 'json' => $organization, 'headers' => ['X-XSRF-TOKEN' => $this->token]]);
     //ensure the response was sent, and the api returned a positive status
     $this->assertSame($response->getStatusCode(), 200);
     $body = $response->getBody();
     $retrievedOrg = json_decode($body);
     $this->assertSame(200, $retrievedOrg->status);
     //pull the value from the DB, and make sure it was properly updated
     $neworg = Organization::getOrganizationByOrgId($this->getPDO(), $organization->getOrgId());
     $this->assertSame($neworg->getOrgName(), $this->VALID_NAME_ALT);
 }
开发者ID:brbrown59,项目名称:bread-basket,代码行数:21,代码来源:org-api-test.php


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