Skip to content

Commit

Permalink
Add PHP 8 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AlfredoRamos committed Dec 26, 2020
1 parent 7738fbb commit e020502
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 49 deletions.
39 changes: 18 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
env:
POSTGRES_HOST: localhost
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
Expand All @@ -57,16 +56,6 @@ jobs:
--health-interval=10s
--health-timeout=5s
--health-retries=3
redis:
image: redis:latest
ports:
- 6379:6379
options: >-
--health-cmd="redis-cli ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
env:
DB: ${{ matrix.db-type }}
MYISAM: 0
Expand All @@ -75,28 +64,34 @@ jobs:
strategy:
matrix:
include:
- php-version: 7.1
- php-version: '7.1'
db-type: 'none'
db-version: 'none'
- php-version: 7.1
- php-version: '7.1'
db-type: 'mysql'
db-version: '5.7'
- php-version: 7.1
- php-version: '7.1'
db-type: 'mariadb'
db-version: '10.5'
- php-version: 7.1
- php-version: '7.1'
db-type: 'postgres'
db-version: '13.1'
- php-version: 7.2
- php-version: '7.2'
db-type: 'mariadb'
db-version: '10.5'
- php-version: 7.3
- php-version: '7.3'
db-type: 'mariadb'
db-version: '10.5'
- php-version: 7.4
- php-version: '7.4'
db-type: 'mysql'
db-version: '8.0'
- php-version: 7.4
- php-version: '7.4'
db-type: 'mariadb'
db-version: '10.5'
- php-version: '8.0'
db-type: 'mariadb'
db-version: '10.5'
- php-version: '8.1'
db-type: 'mariadb'
db-version: '10.5'
steps:
Expand All @@ -116,7 +111,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, mysqli, sqlite, pdo_sqlite, intl, gd, exif, iconv, pgsql, ldap
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, mysqli, intl, gd, exif, iconv, pgsql
tools: composer:v2
coverage: none

Expand All @@ -142,7 +137,9 @@ jobs:
- name: Install extension dependencies
if: ${{ env.EXTDEPS == 1 }}
working-directory: phpBB3/phpBB/ext/${{ env.EXTNAME }}
run: composer update -n --no-dev --prefer-dist --no-progress
run: |
composer require -n --prefer-dist --no-progress 'composer/package-versions-deprecated:^1.11.99' 'ocramius/proxy-manager:~2.1.1'
composer update -n --no-dev --prefer-dist --no-progress
- name: Setup EPV
if: ${{ env.NOTESTS == 1 && env.EPV == 1 }}
Expand Down
3 changes: 1 addition & 2 deletions tests/event/listener_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ class listener_test extends \phpbb_test_case
protected $language;
protected $helper;

public function setUp(): void
protected function setUp(): void
{
parent::setUp();

$this->auth = $this->getMockBuilder(auth::class)->getMock();
$this->config = $this->getMockBuilder(config::class)
->disableOriginalConstructor()->getMock();
Expand Down
11 changes: 5 additions & 6 deletions tests/functional/acp_markdown_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ class acp_markdown_test extends \phpbb_functional_test_case
{
use functional_test_case_trait;

public function setUp(): void
protected function setUp(): void
{
parent::setUp();

$this->login();
$this->admin_login();
$this->add_lang_ext('alfredoramos/markdown', 'acp/info_acp_markdown');
Expand All @@ -34,7 +33,7 @@ public function test_acp_board_features()

$form = $crawler->selectButton($this->lang('SUBMIT'))->form();

$this->assertContains(
$this->assertStringContainsString(
$this->lang('ALLOW_MARKDOWN'),
$crawler->filter('label[for="allow_markdown"]')->text()
);
Expand All @@ -52,7 +51,7 @@ public function test_acp_post_settings()

$form = $crawler->selectButton($this->lang('SUBMIT'))->form();

$this->assertContains(
$this->assertStringContainsString(
$this->lang('ALLOW_POST_MARKDOWN'),
$crawler->filter('label[for="allow_post_markdown"]')->text()
);
Expand All @@ -70,7 +69,7 @@ public function test_acp_private_message_settings()

$form = $crawler->selectButton($this->lang('SUBMIT'))->form();

$this->assertContains(
$this->assertStringContainsString(
$this->lang('ALLOW_PM_MARKDOWN'),
$crawler->filter('label[for="allow_pm_markdown"]')->text()
);
Expand All @@ -88,7 +87,7 @@ public function test_acp_signature_settings()

$form = $crawler->selectButton($this->lang('SUBMIT'))->form();

$this->assertContains(
$this->assertStringContainsString(
$this->lang('ALLOW_SIG_MARKDOWN'),
$crawler->filter('label[for="allow_sig_markdown"]')->text()
);
Expand Down
3 changes: 1 addition & 2 deletions tests/functional/help_markdown_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ class help_markdown_test extends \phpbb_functional_test_case
{
use functional_test_case_trait;

public function setUp(): void
protected function setUp(): void
{
parent::setUp();

$this->add_lang_ext('alfredoramos/markdown', [
'help/markdown'
]);
Expand Down
21 changes: 10 additions & 11 deletions tests/functional/markdown_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ class markdown_test extends \phpbb_functional_test_case
{
use functional_test_case_trait;

public function setUp(): void
protected function setUp(): void
{
parent::setUp();

$this->login();
$this->add_lang_ext('alfredoramos/markdown', [
'posting'
Expand Down Expand Up @@ -95,7 +94,7 @@ public function test_post_markdown()
$post['topic_id']
));

$this->assertContains($expected, $result->html());
$this->assertStringContainsString($expected, $result->html());
}

public function test_private_message()
Expand Down Expand Up @@ -150,7 +149,7 @@ public function test_private_message()
$private_message
));

$this->assertContains($expected, $result->html());
$this->assertStringContainsString($expected, $result->html());
}

public function test_simple_table()
Expand Down Expand Up @@ -199,7 +198,7 @@ public function test_simple_table()
));

$this->assertSame(1, $crawler->filter('table')->count());
$this->assertContains($expected, $result->html());
$this->assertStringContainsString($expected, $result->html());
}

public function test_compact_table()
Expand Down Expand Up @@ -248,7 +247,7 @@ public function test_compact_table()
));

$this->assertSame(1, $crawler->filter('table')->count());
$this->assertContains($expected, $result->html());
$this->assertStringContainsString($expected, $result->html());
}

public function test_table_text_aligntment()
Expand Down Expand Up @@ -299,7 +298,7 @@ public function test_table_text_aligntment()
));

$this->assertSame(1, $crawler->filter('table')->count());
$this->assertContains($expected, $result->html());
$this->assertStringContainsString($expected, $result->html());
}

public function test_block_spoiler()
Expand Down Expand Up @@ -332,7 +331,7 @@ public function test_block_spoiler()
));

$this->assertSame(1, $crawler->filter('.spoiler')->count());
$this->assertContains($expected, $result->html());
$this->assertStringContainsString($expected, $result->html());
}

public function test_inline_spoiler()
Expand Down Expand Up @@ -365,7 +364,7 @@ public function test_inline_spoiler()
));

$this->assertSame(2, $crawler->filter('.spoiler')->count());
$this->assertContains($expected, $result->html());
$this->assertStringContainsString($expected, $result->html());
}

public function test_task_list()
Expand Down Expand Up @@ -425,7 +424,7 @@ public function test_task_list()
$html = $this->task_id_placeholder($result->html());
$expected = $this->task_id_placeholder($expected);

$this->assertContains($expected, $html);
$this->assertStringContainsString($expected, $html);
}

public function test_header_slugs()
Expand Down Expand Up @@ -473,7 +472,7 @@ public function test_header_slugs()
<h6 class="markdown" id="pellentesque-eleifend-feugiat">Pellentesque eleifend feugiat</h6>
EOT;

$this->assertContains($expected, $result->html());
$this->assertStringContainsString($expected, $result->html());
}

private function task_id_placeholder($html = '', $placeholder = '...')
Expand Down
9 changes: 2 additions & 7 deletions tests/functional/ucp_markdown_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ class ucp_markdown_test extends \phpbb_functional_test_case
{
use functional_test_case_trait;

public function setUp(): void
protected function setUp(): void
{
parent::setUp();

$this->login();
$this->add_lang_ext('alfredoramos/markdown', 'ucp/markdown');
}
Expand Down Expand Up @@ -69,10 +68,6 @@ public function test_ucp_signature()
'/app.php/help/markdown',
$crawler->filter('.markdown-status > a')->attr('href')
);

// It needs phpBB v3.2.6-RC1 or greater
// https://tracker.phpbb.com/browse/PHPBB3-15949
// https://github.com/phpbb/phpbb/pull/5519
$this->assertTrue($form->has('disable_markdown'));
}

Expand All @@ -95,6 +90,6 @@ public function test_ucp_signature_preview()

$result = $crawler->filter('.postbody .signature');

$this->assertContains($expected, $result->html());
$this->assertStringContainsString($expected, $result->html());
}
}

0 comments on commit e020502

Please sign in to comment.