/**
  * Tests if the getters return expected results.
  *
  * @dataProvider providePasswordStatusMessages
  */
 public function testStatusMessages($password, $expectedStatus, $expectedMessage)
 {
     $correctHorseBatteryStaple = new CorrectHorseBatteryStaple();
     $correctHorseBatteryStaple->check($password);
     $this->assertEquals($expectedStatus, $correctHorseBatteryStaple->getLastStatus());
     $this->assertEquals($expectedMessage, $correctHorseBatteryStaple->getLastMessage());
 }
 /**
  * Run the API
  */
 public function run()
 {
     $password = $this->getPasswordFromRequestData();
     try {
         $correctHorseBatteryStaple = new CorrectHorseBatteryStaple();
     } catch (RuntimeException $exception) {
         $this->sendErrorResponse('Service unavailable', Response::HTTP_SERVICE_UNAVAILABLE);
     }
     try {
         $correctHorseBatteryStaple->check($password);
         $this->sendResponse(['status' => $correctHorseBatteryStaple->getLastStatus(), 'message' => $correctHorseBatteryStaple->getLastMessage()]);
     } catch (ProcessFailedException $exception) {
         $this->sendErrorResponse('Internal server error');
     }
 }