/** * Test if the newInstance() method will be forwarded to the initial context. * * @return void */ public function testNewInstance() { return; // define the methods to mock $methodsToMock = array('getClassLoader', 'newInstance', 'newService', 'getAttribute', 'getSystemConfiguration'); // create a mock instance $mockInitialContext = $this->getMock('TechDivision\\Application\\Interfaces\\ContextInterface', $methodsToMock); $mockInitialContext->expects($this->any())->method('newInstance')->will($this->returnValue($newInstance = new \stdClass())); // check if the passed instance is equal to the getter one $this->application->injectInitialContext($mockInitialContext); $this->assertEquals($newInstance, $this->application->newInstance('\\stdClass')); }