title: angularjs phonecat tutorial step 5
body: <p>I am reading the angularjs phonecat tutorial. I am currently on the <a href="https://docs.angularjs.org/tutorial/step_05" rel="nofollow">step 5</a>.</p>
  
  <p>In the section "Test", I've found this piece of code:</p>
  
  <pre><code>describe('PhoneCat controllers', function() {
  
  describe('PhoneListCtrl', function(){
    var scope, ctrl, $httpBackend;
  
    // Load our app module definition before each test.
    beforeEach(module('phonecatApp'));
  
    // The injector ignores leading and trailing underscores here (i.e. _$httpBackend_).
    // This allows us to inject a service but then attach it to a variable
    // with the same name as the service in order to avoid a name conflict.
    beforeEach(inject(function(_$httpBackend_, $rootScope, $controller) {
      $httpBackend = _$httpBackend_;
      $httpBackend.expectGET('phones/phones.json').
          respond([{name: 'Nexus S'}, {name: 'Motorola DROID'}]);
  
      scope = $rootScope.$new();
      ctrl = $controller('PhoneListCtrl', {$scope: scope});
    }));
  </code></pre>
  
  <p>I can't understand the reason to create the <em>$httpBackend</em> var. Can you guys explain me?</p>
  
  <p>Thanks in advance.</p>