function createControllerDecorator() {
  angular.mock.$ControllerDecorator = ['$delegate', function($delegate) {
    return function(expression, locals, later, ident) {
      if (later && typeof later === 'object') {
        var instantiate = $delegate(expression, locals, true, ident);
        var instance = instantiate();
        angular.extend(instance, later);
        return instance;
      }
      return $delegate(expression, locals, later, ident);
    };
  }];

  return angular.mock.$ControllerDecorator;
}
@ngdoc service
@name $controller
@description
A decorator for {@link ng.$controller} with additional `bindings` parameter, useful when testing
controllers of directives that use {@link $compile#-bindtocontroller- `bindToController`}.

## Example

```js

// Directive definition ...

myMod.directive('myDirective', {
  controller: 'MyDirectiveController',
  bindToController: {
    name: '@'
  }
});


// Controller definition ...

myMod.controller('MyDirectiveController', ['$log', function($log) {
  this.log = function() {
    $log.info(this.name);
  };
}]);


// In a test ...

describe('myDirectiveController', function() {
  describe('log()', function() {
    it('should write the bound name to the log', inject(function($controller, $log) {
      var ctrl = $controller('MyDirectiveController', { /* no locals &#42;/ }, { name: 'Clark Kent' });
      ctrl.log();

      expect(ctrl.name).toEqual('Clark Kent');
      expect($log.info.logs).toEqual(['Clark Kent']);
    }));
  });
});

```

@param {Function|string} constructor If called with a function then it's considered to be the
   controller constructor function. Otherwise it's considered to be a string which is used
   to retrieve the controller constructor using the following steps:

   * check if a controller with given name is registered via `$controllerProvider`
   * check if evaluating the string on the current scope returns a constructor

   The string can use the `controller as property` syntax, where the controller instance is published
   as the specified property on the `scope`; the `scope` must be injected into `locals` param for this
   to work correctly.

@param {Object} locals Injection locals for Controller.
@param {Object=} bindings Properties to add to the controller instance. This is used to simulate
                          the `bindToController` feature and simplify certain kinds of tests.
@return {Object} Instance of given controller.