/**
  * Test for creating correct demand call
  *
  * @test
  * @return void
  */
 public function listActionFindsDemandedTagsByDemandFromSettings()
 {
     $demand = new Tx_News_Domain_Model_Dto_NewsDemand();
     $settings = array('list' => 'foo', 'orderBy' => 'datetime');
     $configurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
     $fixture = $this->getAccessibleMock('Tx_News_Controller_TagController', array('createDemandObjectFromSettings'));
     $fixture->injectTagRepository($this->tagRepository);
     $fixture->injectConfigurationManager($configurationManager);
     $fixture->setView($this->getMock('Tx_Fluid_View_TemplateView', array(), array(), '', FALSE));
     $fixture->_set('settings', $settings);
     $fixture->expects($this->once())->method('createDemandObjectFromSettings')->will($this->returnValue($demand));
     $this->tagRepository->expects($this->once())->method('findDemanded')->with($demand);
     $fixture->listAction();
     // datetime must be removed
     $this->assertEquals($fixture->_get('settings'), array('list' => 'foo'));
 }