protected function subtest($method, $expectedCode = null, $message = null)
 {
     // Only admin can delete
     if ($method === Request::METHOD_DELETE && User::getCurrentUser() !== $this->admin) {
         $expectedCode = 403;
     }
     return parent::subtest($method, $expectedCode, $message);
 }
Пример #2
0
 protected function subtest($method, $expectedCode = null, $message = null)
 {
     // Nobody can never delete a user
     if ($method === Request::METHOD_DELETE) {
         $expectedCode = 405;
     }
     return parent::subtest($method, $expectedCode, $message);
 }
Пример #3
0
 protected function subtest($method, $expectedCode = null, $message = null)
 {
     $actual = parent::subtest($method, $expectedCode, $message);
     if ($method === Request::METHOD_GET) {
         // location must be extracted as an array with same keys as used in Google Maps API
         $actual = $this->getJsonResponse();
         $this->assertSame(-33.857189, $actual['location']['latitude']);
         $this->assertSame(151.215061, $actual['location']['longitude']);
     }
     return $actual;
 }