Skip to content

Commit

Permalink
D11 Tests (#499)
Browse files Browse the repository at this point in the history
* Update matrix.

* Update tests.

* Static methods updates.

* Minor update.

* Minor update.

* Minor update.

* Update upload-artifact.

* Revert "Minor update."

This reverts commit 487d155.

* Revert "Revert "Minor update.""

This reverts commit 9730027.

* Minor update.

* Fix deprecation.

* Use v3 of upload-artificat.

---------

Co-authored-by: Arnold French <[email protected]>
  • Loading branch information
puresyntax71 and Arnold French authored Sep 13, 2024
1 parent c5b0980 commit 4d57666
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
- drupal: '10.3.*'
civicrm: '5.75.*'
php: '8.3'
- drupal: '11.0.0-beta1@beta'
civicrm: 'dev-master'
- drupal: '^11.0'
civicrm: '5.75.*'
php: '8.3'
name: Drupal ${{ matrix.drupal }} | CiviCRM ${{ matrix.civicrm }}
services:
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
SIMPLETEST_BASE_URL: http://127.0.0.1:8080
MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", {"browserName":"chrome","goog:chromeOptions":{"args":["--disable-gpu", "--no-sandbox", "--headless"]}}, "http://127.0.0.1:9515"]'
BROWSERTEST_OUTPUT_DIRECTORY: '/home/runner/drupal/web/sites/simpletest/browser_output'
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
if: ${{ failure() || success() }}
with:
name: phpunit_browser_output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CiviCRM Entity Fullcalendar Test
type: module
description: 'Test module for CiviCRM Entity and Fullcalendar View.'
package: CiviCRM
core_version_requirement: ^10
core_version_requirement: ^10 || ^11
dependencies:
- drupal:datetime
- drupal:taxonomy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CiviCRM Entity Test
type: module
description: 'Test module for CiviCRM.'
package: CiviCRM
core_version_requirement: ^10
core_version_requirement: ^10 || ^11
dependencies:
- civicrm
- civicrm_entity
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CiviCRM Entity Views Test
type: module
description: 'Test module for CiviCRM Entity and Views.'
package: CiviCRM
core_version_requirement: ^10
core_version_requirement: ^10 || ^11
dependencies:
- drupal:views
- civicrm:civicrm
Expand Down
4 changes: 2 additions & 2 deletions tests/src/FunctionalJavascript/CivicrmEntityViewsTestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ abstract protected function assertViewWithSortsResults();
/**
* Runs setup for the ::testViewWithArguments test.
*/
abstract protected function doSetupViewWithArguments();
abstract public function doSetupViewWithArguments();

/**
* Runs assertions for the ::testViewWithArguments test.
Expand All @@ -257,7 +257,7 @@ abstract protected function assertViewWithArgumentsResults(array $arguments);
* @return \Generator
* The arguments test data.
*/
abstract public function dataArgumentValues();
abstract public static function dataArgumentValues();

/**
* Creates a new View for the tested entity type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function testActivityDragAndUpdate(): void {
// @todo deprecated in Drupal 9.2 PHPUnit bump.
// Change to assertMatchesRegularExpression for PHPUnit 10.
// @see https://www.drupal.org/project/drupal/issues/3217709
$this->assertRegExp(
$this->assertMatchesRegularExpression(
'/^Meeting about new seeds start is now ([0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9]) (2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9]) and end is now ([0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9]) (2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9]) - Do you want to save this change\?$/',
$alert_text
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ protected function assertViewWithSortsResults() {
/**
* {@inheritdoc}
*/
protected function doSetupViewWithArguments() {
public function doSetupViewWithArguments() {
$this->addArgumentToDisplay('name[civicrm_activity.id]');
$this->addFieldToDisplay('name[civicrm_activity.details__value]');
$this->addFieldToDisplay('name[civicrm_activity.location]');
Expand Down Expand Up @@ -179,7 +179,7 @@ protected function assertViewWithArgumentsResults(array $arguments) {
/**
* {@inheritdoc}
*/
public function dataArgumentValues() {
public static function dataArgumentValues() {
yield [[1]];
yield [[2]];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ protected function assertViewWithSortsResults() {
/**
* {@inheritdoc}
*/
protected function doSetupViewWithArguments() {
public function doSetupViewWithArguments() {
$this->addArgumentToDisplay('name[civicrm_address.id]');
$this->addFieldToDisplay('name[civicrm_address.location_type_id]');
$this->addFieldToDisplay('name[civicrm_address.country_id]');
Expand Down Expand Up @@ -203,7 +203,7 @@ protected function assertViewWithArgumentsResults(array $arguments) {
/**
* {@inheritdoc}
*/
public function dataArgumentValues() {
public static function dataArgumentValues() {
yield [[1]];
yield [[2]];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ final class CivicrmContactUserRelationshipTest extends CivicrmEntityTestBase {
* {@inheritdoc}
*/
public function setUp(): void {
if ($this->getName() === 'testWithSeperateDatabase' && empty(getenv('SIMPLETEST_CIVICRM_DB'))) {
if ($this->toString() === 'testWithSeperateDatabase' && empty(getenv('SIMPLETEST_CIVICRM_DB'))) {
$this->markTestSkipped("Cannot run {$this->getName()} without specifying SIMPLETEST_CIVICRM_DB as a seperate database.");
}
parent::setUp();
Expand Down Expand Up @@ -93,7 +93,7 @@ public function setUp(): void {
protected function changeDatabasePrefix() {
parent::changeDatabasePrefix();
// Change the CiviCRM connection to use the separate database.
if ($this->getName() === 'testWithSeperateDatabase') {
if ($this->toString() === 'testWithSeperateDatabase') {
$db_url = getenv('SIMPLETEST_CIVICRM_DB');
Database::removeConnection('civicrm_test');
Database::removeConnection('civicrm');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ protected function assertViewWithSortsResults() {
/**
* {@inheritdoc}
*/
protected function doSetupViewWithArguments() {
public function doSetupViewWithArguments() {
$this->addArgumentToDisplay('name[civicrm_event.id]');
$this->addFieldToDisplay('name[civicrm_event.description__value]');
$this->addFieldToDisplay('name[civicrm_event.summary]');
Expand Down Expand Up @@ -215,7 +215,7 @@ protected function assertViewWithArgumentsResults(array $arguments) {
/**
* {@inheritdoc}
*/
public function dataArgumentValues() {
public static function dataArgumentValues() {
yield [[1]];
yield [[2]];
}
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/CivicrmStorageGetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function testDatetimeTimezone(array $original_datetimes, array $expected_
/**
* Provides datetime and timezone test data.
*/
public function datetimeTimezoneDataProvider() {
public static function datetimeTimezoneDataProvider() {
yield [
[
'start_date' => '2018-05-02 17:00:00',
Expand Down

0 comments on commit 4d57666

Please sign in to comment.