AppserverIo\Appserver\Core\Api\AppService::injectExtractor PHP Method

injectExtractor() public method

Will inject a certain extractor to be used
public injectExtractor ( AppserverIo\Appserver\Core\Interfaces\ExtractorInterface $extractor ) : null
$extractor AppserverIo\Appserver\Core\Interfaces\ExtractorInterface The extractor instance to inject
return null
    public function injectExtractor(ExtractorInterface $extractor)
    {
        $this->extractor = $extractor;
    }

Usage Example

Example #1
0
 /**
  * If we can determine if a passed UUID is an invalid one
  *
  * @return null
  */
 public function testUndeployInvalidUuid()
 {
     $mockExtractor = $this->getMock('\\AppserverIo\\Appserver\\Core\\Interfaces\\ExtractorInterface');
     $mockExtractor->expects($this->never())->method('unflagArchive');
     $this->appService->injectExtractor($mockExtractor);
     $appNode = new AppNode(__METHOD__, '/opt/appserver/targetwebapp');
     $this->appService->undeploy($appNode->getUuid());
 }