Skip to content

Update tests.yml #154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
460 changes: 16 additions & 444 deletions .github/workflows/tests.yml

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "phpbb-extension",
"description": "The official phpBB skeleton extension generator.",
"homepage": "https://www.phpbb.com/customise/db/official_tool/ext_skeleton/",
"version": "1.1.13",
"version": "1.2.0-dev",
"license": "GPL-2.0-only",
"authors": [
{
Expand All @@ -19,7 +19,7 @@
}
],
"require": {
"php": ">=5.6",
"php": ">=8.1",
"composer/installers": "~1.0"
},
"require-dev": {
Expand All @@ -28,13 +28,18 @@
"extra": {
"display-name": "phpBB Skeleton Extension",
"soft-require": {
"phpbb/phpbb": ">=3.2.3,<4.0.0@dev"
"phpbb/phpbb": ">=4.0.0@dev"
},
"version-check": {
"host": "www.phpbb.com",
"directory": "/customise/db/official_tool/ext_skeleton",
"filename": "version_check",
"ssl": true
}
},
"config": {
"allow-plugins": {
"composer/installers": true
}
}
}
160 changes: 156 additions & 4 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion console/create.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use phpbb\skeleton\helper\packager;
use phpbb\skeleton\helper\validator;
use phpbb\user;
use Symfony\Component\Console\Command\Command as SymfonyCommand;
use Symfony\Component\Console\Exception\LogicException;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputInterface;
Expand Down Expand Up @@ -97,7 +98,7 @@ protected function execute(InputInterface $input, OutputInterface $output)

$output->writeln($this->language->lang('EXTENSION_CLI_SKELETON_SUCCESS'));

return 0;
return SymfonyCommand::SUCCESS;
}

/**
Expand Down
13 changes: 4 additions & 9 deletions ext.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,20 @@ public function is_enableable()
*/
protected function phpbb_requirement()
{
if (phpbb_version_compare(PHPBB_VERSION, '3.2.3', '<'))
if (phpbb_version_compare(PHPBB_VERSION, '4.0.0-dev', '<'))
{
$this->errors[] = 'PHPBB_VERSION_MIN_ERROR';
}

else if (phpbb_version_compare(PHPBB_VERSION, '4.0.0-dev', '>='))
{
$this->errors[] = 'PHPBB_VERSION_MAX_ERROR';
$this->errors[] = 'PHPBB_VERSION_ERROR';
}
}

/**
* Check PHP 5.6.0 minimum requirement.
* Check PHP 8.1 minimum requirement.
*
* @return void
*/
protected function php_requirement()
{
if (PHP_VERSION_ID < 50600)
if (PHP_VERSION_ID < 80100)
{
$this->errors[] = 'PHP_VERSION_ERROR';
}
Expand Down
4 changes: 1 addition & 3 deletions helper/packager.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,7 @@ protected function get_template_engine()
$path_helper,
$this->phpbb_container->getParameter('core.cache_dir'),
$this->phpbb_container->get('ext.manager'),
new loader(
new filesystem()
)
new loader()
);

// Custom filter for use by packager to decode greater/less than symbols
Expand Down
5 changes: 2 additions & 3 deletions language/en/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@
'SKELETON_INVALID_PHPBB_MAX_VERSION'=> 'The maximum phpBB version requirement is invalid.',

'NO_ZIPARCHIVE_ERROR' => 'The ZipArchive class is required, but was not found in your PHP configuration.',
'PHP_VERSION_ERROR' => 'PHP 5.6 or newer is required to use this extension.',
'PHPBB_VERSION_MIN_ERROR' => 'phpBB 3.2.3 or newer is required to use this extension.',
'PHPBB_VERSION_MAX_ERROR' => 'phpBB 4 is not supported with this version of the extension. Please check for a newer version of this extension.'
'PHP_VERSION_ERROR' => 'PHP 8.1 or newer is required to use this extension.',
'PHPBB_VERSION_ERROR' => 'phpBB 4.0.0-dev or newer is required to use this extension.',
]);
44 changes: 22 additions & 22 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit backupGlobals="true"
backupStaticAttributes="true"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
verbose="true"
bootstrap="../../../../tests/bootstrap.php"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
backupGlobals="true"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
cacheResult="false"
bootstrap="../../../../tests/bootstrap.php"
>
<coverage>
<include>
<directory suffix=".php">./</directory>
</include>
<exclude>
<directory suffix=".php">./language/</directory>
<directory suffix=".php">./migrations/</directory>
<directory suffix=".php">./tests/</directory>
</exclude>
</coverage>
<testsuites>
<testsuite name="Extension Test Suite">
<directory suffix="_test.php">./tests</directory>
Expand All @@ -20,15 +31,4 @@
<directory suffix="_test.php">./tests/functional/</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./</directory>
<exclude>
<directory suffix=".php">./language/</directory>
<directory suffix=".php">./migrations/</directory>
<directory suffix=".php">./tests/</directory>
</exclude>
</whitelist>
</filter>
</phpunit>
37 changes: 37 additions & 0 deletions skeleton/phpunit.xml.dist.twig
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% if skeleton_version_compare(REQUIREMENTS.phpbb_version_max, "4.0", "<") %}
<?xml version="1.0" encoding="UTF-8"?>

<phpunit backupGlobals="true"
Expand Down Expand Up @@ -40,3 +41,39 @@
</whitelist>
</filter>
</phpunit>
{% else %}
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
backupGlobals="true"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
cacheResult="false"
bootstrap="../../../../tests/bootstrap.php"
>
<coverage>
<include>
<directory suffix=".php">./</directory>
</include>
<exclude>
<directory suffix=".php">./language/</directory>
<directory suffix=".php">./migrations/</directory>
<directory suffix=".php">./tests/</directory>
</exclude>
</coverage>
<testsuites>
<testsuite name="Extension Test Suite">
<directory suffix="_test.php">./tests</directory>
<exclude>./tests/functional</exclude>
</testsuite>
<testsuite name="Extension Functional Tests">
<directory suffix="_test.php">./tests/functional/</directory>
</testsuite>
</testsuites>
</phpunit>
{% endif %}
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
{% if skeleton_version_compare(REQUIREMENTS.phpbb_version_min, "3.2", "<") %}{# for phpBB 3.1.x #}
<li class="small-icon icon-faq no-bulletin"><a href="{{ '{{' }} U_{{ EXTENSION.extension_name|upper }}_PAGE }}">{{ '{{' }} lang('{{ EXTENSION.extension_name|upper }}_PAGE') }}</a></li>
{% else %}{# for phpBB > 3.2.x #}
{% elseif skeleton_version_compare(REQUIREMENTS.phpbb_version_min, "4.0", "<") %}{# for phpBB 3.2.x - 3.3.x #}
<li data-last-responsive="true">
<a href="{{ '{{' }} U_{{ EXTENSION.extension_name|upper }}_PAGE }}" title="{{ '{{' }} lang('{{ EXTENSION.extension_name|upper }}_PAGE') }}" role="menuitem">
<i class="icon fa-question-circle fa-fw" aria-hidden="true"></i><span>{{ '{{' }} lang('{{ EXTENSION.extension_name|upper }}_PAGE') }}</span>
</a>
</li>
{% else %}{# for phpBB > 4.0.x #}
<li data-last-responsive="true">
<a href="{{ '{{' }} U_{{ EXTENSION.extension_name|upper }}_PAGE }}" title="{{ '{{' }} lang('{{ EXTENSION.extension_name|upper }}_PAGE') }}" role="menuitem">
{{ '{{' }} Icon('font', 'circle-question', lang('{{ EXTENSION.extension_name|upper }}_PAGE'), false, 'fas') }}
</a>
</li>
{% endif %}
Loading