Skip to content

Commit

Permalink
Drupal 10.2 compatibility additions, exclude PHP 7 & Drupal 9 from te…
Browse files Browse the repository at this point in the history
…sting matrix (#4099)
  • Loading branch information
jastraat committed Feb 14, 2024
1 parent f4c970b commit 88e03a9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 23 deletions.
34 changes: 17 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ commands:
parameters:
php_version:
description: 'PHP major.minor for DDev to use.'
default: '8.1'
default: '8.2'
type: string
addon_branch:
description: 'Repo branch name for the dkan-ddev-addon you want to test against.'
default: 'main'
type: string
dkan_recommended_branch:
description: 'Branch of getdkan/recommended-project to use.'
default: '10.1.x-dev'
default: '10.2.x-dev'
type: string
steps:
- run:
Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:
type: string
dkan_recommended_branch:
description: 'Branch of getdkan/recommended-project to use.'
default: '10.1.x-dev'
default: '10.2.x-dev'
type: string
report_coverage:
description: 'Generate coverage report and send it to CodeClimate'
Expand Down Expand Up @@ -191,7 +191,7 @@ jobs:
type: string
dkan_recommended_branch:
description: 'Branch of getdkan/recommended-project to use.'
default: '10.1.x-dev'
default: '10.2.x-dev'
type: string
upgrade:
description: 'If true, will install the latest stable DKAN version and test upgrade'
Expand Down Expand Up @@ -230,19 +230,14 @@ workflows:
jobs:
- cypress:
name: install_test_cypress
dkan_recommended_branch: '10.1.x-dev'
- phpunit:
matrix:
parameters:
dkan_recommended_branch: [ '9.5.x-dev']
php_version: [ '7.4', '8.0', '8.1' ]
dkan_recommended_branch: '10.2.x-dev'
- phpunit:
name: 'Install target (Drupal 10.1, PHP 8.1)'
name: 'Install target (Drupal 10.2, PHP 8.2)'
report_coverage: true
matrix:
parameters:
dkan_recommended_branch: [ '10.1.x-dev']
php_version: [ '8.1' ]
dkan_recommended_branch: [ '10.2.x-dev']
php_version: [ '8.2' ]
- phpunit:
matrix:
parameters:
Expand All @@ -253,16 +248,21 @@ workflows:
parameters:
dkan_recommended_branch: [ '10.0.x-dev']
php_version: [ '8.1' ]
- phpunit:
matrix:
parameters:
dkan_recommended_branch: [ '10.2.x-dev']
php_version: [ '8.1' ]
upgrade_and_test:
jobs:
- cypress:
name: upgrade_test_cypress
upgrade: true
dkan_recommended_branch: '10.1.x-dev'
dkan_recommended_branch: '10.2.x-dev'
- phpunit:
name: 'Upgrade target (Drupal 10.1, PHP 8.1)'
name: 'Upgrade target (Drupal 10.2, PHP 8.2)'
upgrade: true
matrix:
parameters:
dkan_recommended_branch: [ '10.1.x-dev']
php_version: [ '8.1' ]
dkan_recommended_branch: [ '10.2.x-dev']
php_version: [ '8.2' ]
2 changes: 1 addition & 1 deletion modules/datastore/src/Storage/DatabaseTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ protected function buildTableSchema(string $tableName, array $fieldsInfo) {
* Drupal Schema API array.
*/
protected function addIndexInfo(array &$schema): void {
if ($this->connection->getConnectionOptions()['driver'] != 'mysql') {
if (!str_contains($this->connection->getConnectionOptions()['driver'], 'mysql')) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@
use Drupal\Core\Config\ConfigFactory;
use Drupal\Core\Config\ImmutableConfig;
use Drupal\metastore\DataDictionary\DataDictionaryDiscovery as Discovery;
use Drupal\metastore\MetastoreService;
use Drupal\metastore\Reference\MetastoreUrlGenerator;
use Drupal\metastore\Reference\ReferenceLookup;
use Drupal\metastore\Service;
use MockChain\Chain;
use MockChain\Options;
use OutOfRangeException;
use PHPUnit\Framework\TestCase;
use RootedData\RootedJsonData;

class DataDictionaryDiscoveryTest extends TestCase {


// If mode is set to "none", we should get NULL no matter what.
public function testModeNone() {
Expand Down Expand Up @@ -66,7 +65,7 @@ public function testGetReferenceDictId() {
$this->getMetastoreService(),
$this->getLookup(),
$this->getUrlGenerator()
);
);
$id = $discovery->dictionaryIdFromResource('resource1');
$this->assertEquals('111', $id);

Expand Down Expand Up @@ -136,7 +135,7 @@ private function getMetastoreService() {
->add('444', new RootedJsonData($json4, "{}"))
->index(1);
return (new Chain($this))
->add(Service::class, 'get', $sequence)
->add(MetastoreService::class, 'get', $sequence)
->getMock();
}

Expand All @@ -148,7 +147,7 @@ private function getUrlGenerator() {
$uriFromUrl = (new Options())
->add('https://example.com/api/1/metastore/schemas/data-dictionary/items/111', 'dkan://metastore/schemas/data-dictionary/items/111')
->add('dkan://metastore/schemas/dataset/items/444', 'dkan://metastore/schemas/dataset/items/444');

return (new Chain($this))
->add(MetastoreUrlGenerator::class, 'uriFromUrl', $uriFromUrl)
->add(MetastoreUrlGenerator::class, 'extractItemId', $extract)
Expand Down

0 comments on commit 88e03a9

Please sign in to comment.