def test_find_all_php_versions(self): ctx = {'BP_DIR': '.'} manifest = load_manifest(ctx) dependencies = manifest['dependencies'] versions = find_all_php_versions(dependencies) eq_(2, len([v for v in versions if v.startswith('5.5.')])) eq_(2, len([v for v in versions if v.startswith('5.6.')]))
def test_find_all_php_versions(self): ctx = {'BP_DIR': '.'} manifest = load_manifest(ctx) dependencies = manifest['dependencies'] versions = find_all_php_versions(dependencies) eq_(2, len([v for v in versions if v.startswith('7.1.')])) eq_(2, len([v for v in versions if v.startswith('7.2.')]))
def test_load_manifest(self): ctx = {'BP_DIR': '.'} manifest = load_manifest(ctx) assert manifest is not None assert 'dependencies' in manifest.keys() assert 'language' in manifest.keys() assert 'url_to_dependency_map' in manifest.keys() assert 'exclude_files' in manifest.keys()
def _defaults(self): manifest = load_manifest(self._ctx) dependencies = manifest['dependencies'] composer = (d for d in dependencies if d["name"] == "composer").next() return { 'COMPOSER_VERSION': composer['version'], 'COMPOSER_PACKAGE': 'composer.phar', 'COMPOSER_DOWNLOAD_URL': '/composer/' '{COMPOSER_VERSION}/{COMPOSER_PACKAGE}', 'COMPOSER_INSTALL_OPTIONS': ['--no-interaction', '--no-dev'], 'COMPOSER_VENDOR_DIR': '{BUILD_DIR}/{LIBDIR}/vendor', 'COMPOSER_BIN_DIR': '{BUILD_DIR}/php/bin', 'COMPOSER_CACHE_DIR': '{CACHE_DIR}/composer' }
def test_find_php_extensions(self): ctx = {'BP_DIR': '.'} manifest = load_manifest(ctx) dependencies = manifest['dependencies'] exts = find_all_php_extensions(dependencies) eq_(9, len(exts.keys())) tmp = exts[[key for key in exts.keys() if key.startswith('5.4')][0]] assert 'amqp' in tmp assert 'apc' in tmp assert 'imap' in tmp assert 'ldap' in tmp assert 'phalcon' in tmp assert 'pspell' in tmp assert 'pdo_pgsql' in tmp assert 'mailparse' in tmp assert 'redis' in tmp assert 'pgsql' in tmp assert 'snmp' in tmp assert 'cgi' not in tmp assert 'cli' not in tmp assert 'fpm' not in tmp assert 'pear' not in tmp
def test_find_php_extensions(self): ctx = {'BP_DIR': '.'} manifest = load_manifest(ctx) dependencies = manifest['dependencies'] exts = find_all_php_extensions(dependencies) eq_(6, len(exts.keys())) tmp = exts[[key for key in exts.keys() if key.startswith('5.4')][0]] assert 'amqp' in tmp assert 'apc' in tmp assert 'imap' in tmp assert 'ldap' in tmp assert 'phalcon' in tmp assert 'pspell' in tmp assert 'pdo_pgsql' in tmp assert 'mailparse' in tmp assert 'redis' in tmp assert 'pgsql' in tmp assert 'snmp' in tmp assert 'cgi' not in tmp assert 'cli' not in tmp assert 'fpm' not in tmp assert 'pear' not in tmp
def _configure(self): manifest = load_manifest(self._ctx) dependencies = manifest['dependencies'] self._ctx['ALL_PHP_VERSIONS'] = find_all_php_versions(dependencies)
def _configure(self): manifest = load_manifest(self._ctx) dependencies = manifest["dependencies"] self._ctx["ALL_PHP_VERSIONS"] = find_all_php_versions(dependencies) self._ctx["ALL_PHP_EXTENSIONS"] = find_all_php_extensions(dependencies)