protected function mockComposerObjects($packageExtraValue = null) { $this->composerMock = $this->getMock('Composer\\Composer', array('getPackage')); $this->packageMock = $this->getMockForAbstractClass('Composer\\Package\\PackageInterface'); $this->packageMock->expects($this->any())->method('getExtra')->will($this->returnValue($packageExtraValue)); $this->composerMock->expects($this->any())->method('getPackage')->will($this->returnValue($this->packageMock)); $this->composerEventMock = $this->getMock('Composer\\Script\\Event', array('getComposer'), array('postPackageUpdate', $this->composerMock, $this->getMockForAbstractClass('Composer\\IO\\IOInterface'), true)); $this->composerEventMock->expects($this->any())->method('getComposer')->will($this->returnValue($this->composerMock)); }