Skip to content

Commit

Permalink
Update PHP dependency, dev dependencies, and workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Penny authored and chrispenny committed May 1, 2022
1 parent 67d18dc commit 47a70e1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 31 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,4 @@ on:

jobs:
ci:
uses: silverstripe/github-actions-ci-cd/.github/workflows/[email protected]
with:
default_jobs: |
- php: 7.4
phpcoverage: true
- php: 7.4
phplinting: true
- php: 7.4
phpunit: true
- php: 8.0
phpunit: true
uses: silverstripe/github-actions-ci-cd/.github/workflows/[email protected]
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
"issues": "https://github.com/silverstripe-terraformers/embargo-expiry/issues"
},
"require": {
"php": "^7.1 || ^8.0",
"php": "^7.4 || ^8.0",
"silverstripe/vendor-plugin": "^1.0",
"silverstripe/framework": "^4@dev",
"silverstripe/cms": "^4@dev",
"symbiote/silverstripe-queuedjobs": "^4.0.0",
"opis/closure": "^3.6"
},
"require-dev": {
"phpunit/phpunit": "^5.7",
"tractorcow/silverstripe-fluent": "^4.2.0"
"phpunit/phpunit": "^9.5",
"tractorcow/silverstripe-fluent": "^6.0"
},
"extra": {
"expose": [
Expand Down
34 changes: 17 additions & 17 deletions tests/php/Extension/EmbargoExpiryExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

namespace Terraformers\EmbargoExpiry\Tests\Extension;

use DateTimeImmutable;
use Exception;
use Page;
use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Core\Config\Config;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\FormAction;
use SilverStripe\Forms\LiteralField;
use SilverStripe\Forms\TabSet;
use SilverStripe\ORM\FieldType\DBDatetime;
Expand All @@ -16,7 +17,6 @@
use Symbiote\QueuedJobs\Services\QueuedJobService;
use Terraformers\EmbargoExpiry\Extension\EmbargoExpiryExtension;
use Terraformers\EmbargoExpiry\Tests\Fake\TestQueuedJobService;
use DateTimeImmutable;

/**
* Class EmbargoExpiryExtensionTest
Expand Down Expand Up @@ -239,9 +239,9 @@ public function testMessageConditionsCanEdit(): void
$expectedEmbargoMessage = sprintf('Embargo</strong>: 2014-01-07 12:00 %s', $time->getTimezone()->getName());
$expectedExpiryMessage = sprintf('Embargo</strong>: 2014-01-07 12:00 %s', $time->getTimezone()->getName());

$this->assertNotContains('cannot currently be edited', $content);
$this->assertContains($expectedEmbargoMessage, $content);
$this->assertContains($expectedExpiryMessage, $content);
$this->assertStringNotContainsString('cannot currently be edited', $content);
$this->assertStringContainsString($expectedEmbargoMessage, $content);
$this->assertStringContainsString($expectedExpiryMessage, $content);
}

public function testMessageConditionsCannotEditGuest(): void
Expand Down Expand Up @@ -269,10 +269,10 @@ public function testMessageConditionsCannotEditGuest(): void
$expectedEmbargoMessage = sprintf('Embargo</strong>: 2014-01-07 12:00 %s', $time->getTimezone()->getName());
$expectedExpiryMessage = sprintf('Embargo</strong>: 2014-01-07 12:00 %s', $time->getTimezone()->getName());

$this->assertContains('cannot currently be edited', $content);
$this->assertContains('An administrator will need', $content);
$this->assertContains($expectedEmbargoMessage, $content);
$this->assertContains($expectedExpiryMessage, $content);
$this->assertStringContainsString('cannot currently be edited', $content);
$this->assertStringContainsString('An administrator will need', $content);
$this->assertStringContainsString($expectedEmbargoMessage, $content);
$this->assertStringContainsString($expectedExpiryMessage, $content);
}

public function testMessageConditionsCannotEditAdmin(): void
Expand Down Expand Up @@ -300,10 +300,10 @@ public function testMessageConditionsCannotEditAdmin(): void
$expectedEmbargoMessage = sprintf('Embargo</strong>: 2014-01-07 12:00 %s', $now->getTimezone()->getName());
$expectedExpiryMessage = sprintf('Embargo</strong>: 2014-01-07 12:00 %s', $now->getTimezone()->getName());

$this->assertContains('cannot currently be edited', $content);
$this->assertContains('You will need to remove', $content);
$this->assertContains($expectedEmbargoMessage, $content);
$this->assertContains($expectedExpiryMessage, $content);
$this->assertStringContainsString('cannot currently be edited', $content);
$this->assertStringContainsString('You will need to remove', $content);
$this->assertStringContainsString($expectedEmbargoMessage, $content);
$this->assertStringContainsString($expectedExpiryMessage, $content);
}

public function testMessageConditionsWarning(): void
Expand Down Expand Up @@ -338,8 +338,8 @@ public function testMessageConditionsWarning(): void
);

// Test that the two warning messages were added.
$this->assertContains($expectedEmbargoMessage, $content);
$this->assertContains($expectedExpiryMessage, $content);
$this->assertStringContainsString($expectedEmbargoMessage, $content);
$this->assertStringContainsString($expectedExpiryMessage, $content);
}

public function testEmbargoExpiryFieldNoticeMessageNotEditable(): void
Expand All @@ -364,7 +364,7 @@ public function testEmbargoExpiryFieldNoticeMessageWithPermission(): void
$message = $page->getEmbargoExpiryFieldNoticeMessage();

$this->assertNotNull($message);
$this->assertContains('Enter a date and/or time', $message);
$this->assertStringContainsString('Enter a date and/or time', $message);
}

public function testEmbargoExpiryFieldNoticeMessageWithoutPermission(): void
Expand All @@ -379,7 +379,7 @@ public function testEmbargoExpiryFieldNoticeMessageWithoutPermission(): void
$message = $page->getEmbargoExpiryFieldNoticeMessage();

$this->assertNotNull($message);
$this->assertContains('Please contact an administrator', $message);
$this->assertStringContainsString('Please contact an administrator', $message);
}

public function testAddDesiredDateFieldsWithoutPermission(): void
Expand Down

0 comments on commit 47a70e1

Please sign in to comment.