title: Should functional test just assert responses only?
body: <p>I have some confused question about testing. </p>
  
  <p>We're using <code>Slim</code> as framework of the system. As I know, <code>Unit Test</code> is the minimum of testing. For example, to test if the class or method works as expected. </p>
  
  <p>To test another functions of the system, for example, the system provide an API to search products information, this search function designed by the following thoughts:</p>
  
  <ol>
  <li>Clients post keyword to the API entry. eg. <code>/search</code></li>
  <li>Handle the request and inject <code>SearchService</code> into the controller.</li>
  <li>Set the keyword to the <code>SearhService</code>.</li>
  <li>Push the keyword into the database. eg. <code>search_history</code>.</li>
  <li>Fetch the search result back to controller, and response to clients.</li>
  </ol>
  
  <p>This is how <code>search API</code> designs. </p>
  
  <p>And we created a functional test for the <code>Search API</code> called <code>SearchTest</code>. This is how we done:</p>
  
  <ol>
  <li>Use <code>$this-&gt;runApp()</code> method provided by <code>Slim</code> to sending requests to the API entry.</li>
  <li>Set several test cases to test different kind of scenario, such as <strong>"No keyword provided"</strong>, <strong>"No search result"</strong> ... etc.</li>
  <li>Assert the responses that return value or HTTP status as expected. </li>
  </ol>
  
  <p>Some questions are confusing: </p>
  
  <ul>
  <li>Sending requests and asserting the responses, is that all? Do we misunderstand so called <strong>"functional testing"</strong>? </li>
  <li>We shouldn't care about how it works, we just need to send request and assert the responses, right? </li>
  <li>If not, should we check dependencies or used components work as expected? For example, should we connect to the database, and check if the keyword pushing success or not? </li>
  </ul>