/**
  * @test
  * @dataProvider mockedCollector
  */
 public function itShouldOutputCollectionCorrectly(ViewComposerCollector $collector, CliDumper $dumper, VarCloner $cloner)
 {
     $view = Mockery::mock(View::class);
     $collector->shouldReceive('describeViewComposer')->once()->with($view, $viewComposer = "I'm a View Composer")->andReturn($resultOne = "I'm a description");
     $collector->addViewComposer($view, $viewComposer);
     $collector->shouldReceive('describeViewComposer')->once()->with($view, $viewComposer = "I'm a View Composer, too!")->andReturn($resultTwo = "I'm a description, too!");
     $collector->addViewComposer($view, $viewComposer);
     $this->assertSame(['view-composers' => [['message' => $resultOne], ['message' => $resultTwo]], 'count' => 2], $collector->collect());
 }
 public function boot(LaravelDebugbar $debugBar, EventDispatcher $eventDispatcher, ViewComposerCollector $viewComposerCollector)
 {
     $eventDispatcher->listen("creating: *", function (View $view) use($viewComposerCollector, $eventDispatcher) {
         foreach ($this->findApplicableComposers($view, $eventDispatcher) as $composer) {
             $viewComposerCollector->addViewComposer($view, $composer);
         }
     });
     $debugBar->addCollector($viewComposerCollector);
 }