/**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     $this->container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerInterface');
     $this->command = new FixMediaContextCommand();
     $this->command->setContainer($this->container);
     $this->application = new Application();
     $this->application->add($this->command);
     $this->tester = new CommandTester($this->application->find('sonata:media:fix-media-context'));
     $this->pool = $pool = $this->getMockBuilder('Sonata\\MediaBundle\\Provider\\Pool')->disableOriginalConstructor()->getMock();
     $this->contextManger = $contextManger = $this->getMock('Sonata\\ClassificationBundle\\Model\\ContextManagerInterface');
     $this->categoryManger = $categoryManger = $this->getMockBuilder('Sonata\\ClassificationBundle\\Entity\\CategoryManager')->disableOriginalConstructor()->getMock();
     $this->container->expects($this->any())->method('get')->will($this->returnCallback(function ($id) use($pool, $contextManger, $categoryManger) {
         switch ($id) {
             case 'sonata.media.pool':
                 return $pool;
             case 'sonata.classification.manager.context':
                 return $contextManger;
             case 'sonata.classification.manager.category':
                 return $categoryManger;
         }
         return;
     }));
 }