Skip to content
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

[php8-compat][phpunit8][NFC] Fix PHPUnit Warnings and fix a php error on f… #20477

Merged
merged 1 commit into from
Jun 2, 2021
Merged
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
2 changes: 1 addition & 1 deletion ext/afform/mock/ang/mockPublicForm.test.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function testGetPage() {
$this->assertContentType('text/html', $r);
$this->assertStatusCode(200, $r);
$body = (string) $r->getBody();
$this->assertContains('mockPublicForm', $body);
$this->assertStringContainsString('mockPublicForm', $body);
}

public function testPublicCreateAllowed() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ abstract class FormTestCase extends \PHPUnit\Framework\TestCase implements \Civi

protected $formName = NULL;

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

if ($this->formName === NULL && preg_match(';^(.*)\.test\.php$;', basename(static::FILE), $m)) {
Expand All @@ -45,7 +45,7 @@ protected function setUp() {
}
}

protected function tearDown() {
protected function tearDown(): void {
parent::tearDown();
}

Expand Down
32 changes: 16 additions & 16 deletions ext/flexmailer/tests/phpunit/Civi/FlexMailer/MailingPreviewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ public function testMailerPreview(): void {
$this->assertEquals("[CiviMail Draft] Hello $displayName",
$previewResult['values']['subject']);

$this->assertContains("This is $displayName", $previewResult['values']['body_text']);
$this->assertContains("civicrm/mailing/optout", $previewResult['values']['body_text']);
$this->assertContains("&jid=&qid=&h=fakehash", $previewResult['values']['body_text']);
$this->assertContains("subj=(Hello ", $previewResult['values']['body_text']);
$this->assertStringContainsString("This is $displayName", $previewResult['values']['body_text']);
$this->assertStringContainsString("civicrm/mailing/optout", $previewResult['values']['body_text']);
$this->assertStringContainsString("&jid=&qid=&h=fakehash", $previewResult['values']['body_text']);
$this->assertStringContainsString("subj=(Hello ", $previewResult['values']['body_text']);

$this->assertContains("<p>This is $displayName.</p>", $previewResult['values']['body_html']);
$this->assertContains("civicrm/mailing/optout", $previewResult['values']['body_html']);
$this->assertContains("&amp;jid=&amp;qid=&amp;h=fakehash", $previewResult['values']['body_html']);
$this->assertContains("subj=(Hello ", $previewResult['values']['body_html']);
$this->assertStringContainsString("<p>This is $displayName.</p>", $previewResult['values']['body_html']);
$this->assertStringContainsString("civicrm/mailing/optout", $previewResult['values']['body_html']);
$this->assertStringContainsString("&amp;jid=&amp;qid=&amp;h=fakehash", $previewResult['values']['body_html']);
$this->assertStringContainsString("subj=(Hello ", $previewResult['values']['body_html']);

$this->assertEquals('flexmailer', $previewResult['values']['_rendered_by_']);
}
Expand All @@ -115,15 +115,15 @@ public function testMailerPreviewWithoutId(): void {
$this->assertEquals("[CiviMail Draft] Hello $displayName",
$previewResult['values']['subject']);

$this->assertContains("This is $displayName", $previewResult['values']['body_text']);
$this->assertContains("civicrm/mailing/optout", $previewResult['values']['body_text']);
$this->assertContains("&jid=&qid=&h=fakehash", $previewResult['values']['body_text']);
$this->assertContains("subj=(Hello ", $previewResult['values']['body_text']);
$this->assertStringContainsString("This is $displayName", $previewResult['values']['body_text']);
$this->assertStringContainsString("civicrm/mailing/optout", $previewResult['values']['body_text']);
$this->assertStringContainsString("&jid=&qid=&h=fakehash", $previewResult['values']['body_text']);
$this->assertStringContainsString("subj=(Hello ", $previewResult['values']['body_text']);

$this->assertContains("<p>This is $displayName.</p>", $previewResult['values']['body_html']);
$this->assertContains("civicrm/mailing/optout", $previewResult['values']['body_html']);
$this->assertContains("&amp;jid=&amp;qid=&amp;h=fakehash", $previewResult['values']['body_html']);
$this->assertContains("subj=(Hello ", $previewResult['values']['body_html']);
$this->assertStringContainsString("<p>This is $displayName.</p>", $previewResult['values']['body_html']);
$this->assertStringContainsString("civicrm/mailing/optout", $previewResult['values']['body_html']);
$this->assertStringContainsString("&amp;jid=&amp;qid=&amp;h=fakehash", $previewResult['values']['body_html']);
$this->assertStringContainsString("subj=(Hello ", $previewResult['values']['body_html']);

$this->assertEquals('flexmailer', $previewResult['values']['_rendered_by_']);
}
Expand Down