Changeset e498070 for src/webservice/tests/StationsTest.php
- Timestamp:
- Sep 9, 2015, 10:03:34 PM (11 years ago)
- Branches:
- master
- Children:
- 915dc18
- Parents:
- d83a844
- File:
-
- 1 edited
-
src/webservice/tests/StationsTest.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/webservice/tests/StationsTest.php
rd83a844 re498070 77 77 // sending must failing register request, caused by unproven location 78 78 $response = $client->post("index.php/stations/register", 79 [ "json" => ["name" => "Cool Station", "longitude" => 23.2, "latitude" => 90, "city" => "Nice town", " email" => "test@example.org"]]79 [ "json" => ["name" => "Cool Station", "longitude" => 23.2, "latitude" => 90, "city" => "Nice town", "type" => "testing", "email" => "test@example.org"]] 80 80 ); 81 81 $this->assertEquals($response->getStatusCode(), 200, $response->getReasonPhrase()); … … 101 101 102 102 $response = $client->post("index.php/stations/register", 103 [ "json" => ["name" => "My Weather Station", "city" => "Clausthal-Zellerfeld", "longitude" => 10.28152, "latitude" => 51.8281, " email" => "test@example.org"]]103 [ "json" => ["name" => "My Weather Station", "city" => "Clausthal-Zellerfeld", "longitude" => 10.28152, "latitude" => 51.8281, "type" => "testing", "email" => "test@example.org"]] 104 104 ); 105 105 $this->assertEquals(200, $response->getStatusCode(), $response->getReasonPhrase()); 106 106 $json = json_decode($response->getBody(), true); 107 107 $this->assertTrue(array_key_exists("result", $json)); 108 $this->assertEquals("success", $json["result"] );108 $this->assertEquals("success", $json["result"], $json["message"]); 109 109 $this->assertTrue(array_key_exists("uuid", $json)); 110 110 $this->assertTrue(!empty($json["uuid"])); 111 $this->assertTrue(array_key_exists("message", $json)); 112 $this->assertTrue(!empty($json["message"])); 111 113 112 114 $stations = $this->query("index.php/stations");
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/siweather/chrome/site/your_project_logo.png)