/** * Returns the list of mock objects associated with the current test. * * @param array $constructorArgs * @return object[] */ public function getMocks(array $constructorArgs = array()) { if ($this->mocks === null) { $mockBuilder = new MockBuilder($this); $this->mocks = $mockBuilder->getMocks($constructorArgs); } return $this->mocks; }
public function testGetMocksWithUndefinedFile() { $mockBuilder = new MockBuilder(new Test(new ReflectionMethod(__CLASS__, __FUNCTION__))); $this->setExpectedException('RuntimeException', 'File not found'); $this->assertInstanceOf('TRex\\core\\Objects', $mockBuilder->getMocks()); }