/** * testGetQueryBuilderGenerate */ public function testGetQueryBuilderGenerate() { $expectedResults = 'asdf'; $this->dataTable->setMetaData(array('table' => $this->table)); $this->table->entity = 'test'; $this->dataTable->setEm($this->em); $this->repo->testing = function () { }; Phake::when($this->em)->getRepository(Phake::anyParameters())->thenReturn($this->repo); Phake::when($this->repo)->createQueryBuilder(Phake::anyParameters())->thenReturn($expectedResults); $result = $this->dataTable->getQueryBuilder(); $this->assertEquals($expectedResults, $result); }