AppserverIo\Appserver\Core\Scanner\Mock\MockAbstractScanner::testableGetDistributionVersion PHP Method

testableGetDistributionVersion() public method

This method will check for the Linux release file normally stored in /etc and will return the version of the distribution
public testableGetDistributionVersion ( string | null $distribution = null, array $etcList = [] ) : string | boolean
$distribution string | null Distribution to search a version for
$etcList array List of already collected AND flipped release files we need to filter
return string | boolean
    public function testableGetDistributionVersion($distribution = null, $etcList = array())
    {
        return $this->getDistributionVersion($distribution, $etcList);
    }

Usage Example

 /**
  * Tests the getDistributionVersion() method.
  *
  * @param string      $distribution The OS to return the restart command for
  * @param string|null $distVersion  Version of the operating system to get the restart command for
  *
  * @return void
  *
  * @dataProvider getDistributionVersionDataProvider
  */
 public function testGetDistributionVersion($distribution, $distVersion)
 {
     // mock the configuration
     $mockScanner = new MockAbstractScanner($this->getMockInitialContext(), 'TestScanner');
     // check that the cache directory has been initialized successfully
     $this->assertSame($distVersion, $mockScanner->testableGetDistributionVersion($distribution));
 }