protected function setUp() { $this->optimizer = $this->getMock('Oro\\Bundle\\BatchBundle\\ORM\\QueryBuilder\\CountQueryBuilderOptimizer'); $this->optimizer->expects($this->any())->method('getCountQueryBuilder')->with($this->isInstanceOf('Doctrine\\ORM\\QueryBuilder'))->willReturnArgument(0); $this->handler = $this->getMockBuilder('Oro\\Bundle\\SoapBundle\\Handler\\TotalHeaderHandler')->setConstructorArgs([$this->optimizer])->setMethods(['calculateCount'])->getMock(); $configuration = $this->getMockBuilder('Doctrine\\ORM\\Configuration')->disableOriginalConstructor()->getMock(); $configuration->expects($this->any())->method('getDefaultQueryHints')->will($this->returnValue([])); $configuration->expects($this->any())->method('isSecondLevelCacheEnabled')->will($this->returnValue(false)); $this->em = $this->getMockBuilder('Doctrine\\ORM\\EntityManager')->disableOriginalConstructor()->getMock(); $this->em->expects($this->any())->method('getConfiguration')->will($this->returnValue($configuration)); }
protected function setUp() { $this->optimizer = $this->getMock('Oro\\Bundle\\BatchBundle\\ORM\\QueryBuilder\\CountQueryBuilderOptimizer'); $this->optimizer->expects($this->any())->method('getCountQueryBuilder')->with($this->isInstanceOf('Doctrine\\ORM\\QueryBuilder'))->willReturnArgument(0); $this->handler = $this->getMockBuilder('Oro\\Bundle\\SoapBundle\\Handler\\TotalHeaderHandler')->setConstructorArgs([$this->optimizer])->setMethods(['calculateCount'])->getMock(); }