public function testInvalidPut()
 {
     $volunteer = new Volunteer(BreadBasketTest::INVALID_KEY, $this->valid_org_id, $this->VALID_EMAIL, $this->VALID_EMAIL_ACTIVATION, $this->VALID_FIRST_NAME, $this->VALID_HASH, $this->VALID_ADMIN, $this->VALID_LAST_NAME, $this->VALID_PHONE, $this->VALID_SALT);
     $response = $this->guzzle->put('https://bootcamp-coders.cnm.edu/~kkeller13/bread-basket/public_html/php/api/volunteer/' . BreadBasketTest::INVALID_KEY, ['allow-redirects' => ['strict' => true], 'json' => $volunteer, 'headers' => ['X-XSRF-TOKEN' => $this->token]]);
     //make sure the request returns the proper error code for a failed operation
     $body = $response->getBody();
     $retrievedVol = json_decode($body);
     $this->assertSame(404, $retrievedVol->status);
 }
示例#2
0
 /**
  * test putting an invalidvalid organization into the API
  */
 public function testInvalidPut()
 {
     //test to make sure can't put to an organization that doesn't exist
     $organization = new Organization(BreadBasketTest::INVALID_KEY, $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);
     $response = $this->guzzle->put('https://bootcamp-coders.cnm.edu/~bbrown52/bread-basket/public_html/php/api/organization/' . BreadBasketTest::INVALID_KEY, ['allow-redirects' => ['strict' => true], 'json' => $organization, 'headers' => ['X-XSRF-TOKEN' => $this->token]]);
     //make sure the request returns the proper error code for a failed operation
     $body = $response->getBody();
     $retrievedOrg = json_decode($body);
     $this->assertSame(404, $retrievedOrg->status);
 }