/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. */ protected function setUp() { $this->metadataFactory = $this->getMock('Doctrine\\Search\\Mapping\\ClassMetadataFactory'); $this->searchClient = $this->getMockBuilder('Doctrine\\Search\\ElasticSearch\\Client')->disableOriginalConstructor()->getMock(); $this->configuration = $this->getMock('Doctrine\\Search\\Configuration'); $this->configuration->expects($this->once())->method('getClassMetadataFactory')->will($this->returnValue($this->metadataFactory)); $this->configuration->expects($this->once())->method('getMetadataCacheImpl')->will($this->returnValue($this->getMock('Doctrine\\Common\\Cache\\ArrayCache'))); $this->evm = new EventManager(); $this->sm = new SearchManager($this->configuration, $this->searchClient, $this->evm); }