Skip to content

Commit

Permalink
Update github workflow and dataProviders with static.
Browse files Browse the repository at this point in the history
  • Loading branch information
apathak18 committed Jul 18, 2024
1 parent 03607d1 commit 41bc902
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 14 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ jobs:
composer --no-interaction run-script drupal-phpunit-upgrade
composer config --no-plugins allow-plugins.phpstan/extension-installer true
# Revisit - check for latest release of dependent modules.
- name: Install GraphQL dependencies
run: |
composer --no-interaction --no-progress require \
webonyx/graphql-php:^14.8 \
webonyx/graphql-php:^15.12 \
drupal/typed_data:^1.0 \
drupal/redirect:^1.0
Expand All @@ -109,11 +110,11 @@ jobs:
run: |
composer --no-interaction --no-progress require \
phpstan/phpstan:^1.11.2 \
mglaman/phpstan-drupal:^1.1.2 \
phpstan/phpstan-deprecation-rules:^1.0.0 \
mglaman/phpstan-drupal:^1.2.11 \
phpstan/phpstan-deprecation-rules:^1.2.0 \
jangregor/phpstan-prophecy:^1.0.0 \
phpstan/phpstan-phpunit:^1.0.0 \
phpstan/extension-installer:^1.0
phpstan/phpstan-phpunit:^1.4 \
phpstan/extension-installer:^1.4
composer --no-interaction --no-progress --with-all-dependencies upgrade drupal/coder:8.3.24
- name: Run PHPStan
Expand Down
19 changes: 19 additions & 0 deletions 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Update github workflow to ready for drupal next minor and major version.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# Author: Ankit Pathak <[email protected]>
#
# interactive rebase in progress; onto 75dd0a4
# Last commands done (2 commands done):
# pick 6515b02 Drupal 11 readiness.
# pick 8c2bcaf Update github workflow to ready for drupal next minor and major version.
# Next commands to do (2 remaining commands):
# pick 14bba39 Update github workflow and dataProviders with static.
# pick c456f77 Adding minimum php version 8.0 and included typed_data module.
# You are currently rebasing branch '8.x-4.x' on '75dd0a4'.
#
# Changes to be committed:
# modified: .github/workflows/testing.yml
#
2 changes: 1 addition & 1 deletion tests/src/Kernel/DataProducer/EntityReferenceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public function testEmptyResults(string $data_producer, array $contexts): void {
/**
* Data provider for testEmptyResults().
*/
public function emptyResultsProvider(): array {
public static function emptyResultsProvider(): array {
return [
// Test that an empty reference field returns an empty array.
['entity_reference', [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function testImageResourceUrl(array $input, string $expected): void {
/**
* Provider for testImageResourceUrl().
*/
public function imageResourceUrlProvider(): array {
public static function imageResourceUrlProvider(): array {
return [
[
['url' => 'http://localhost/test_image.jpg'],
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/DataProducer/SeekTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function testSeek(array $input, int $position, $expected): void {
*
* @return array
*/
public function seekProvider(): array {
public static function seekProvider(): array {
return [
[
[1, 2, 3],
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/DataProducer/StringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function testUppercase(string $input, string $expected): void {
/**
* Tests the upper case data producer.
*/
public function uppercaseProvider(): array {
public static function uppercaseProvider(): array {
return [
['test', 'TEST'],
['123 ..!!', '123 ..!!'],
Expand Down
6 changes: 3 additions & 3 deletions tests/src/Kernel/Framework/CsrfTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function testEvilOrigin(string $content_type): void {
/**
* Data provider for testContentTypeCsrf().
*/
public function provideSimpleContentTypes(): array {
public static function provideSimpleContentTypes(): array {
// Three content types that can be sent with simple no-cors POST requests.
return [
['text/plain'],
Expand Down Expand Up @@ -115,7 +115,7 @@ public function testAllowedJsonRequests(array $headers): void {
/**
* Data provider for testAllowedJsonRequests().
*/
public function provideAllowedJsonHeaders(): array {
public static function provideAllowedJsonHeaders(): array {
return [
[['CONTENT_TYPE' => 'application/json']],
[['CONTENT_TYPE' => 'application/graphql']],
Expand Down Expand Up @@ -149,7 +149,7 @@ public function testAllowedFormRequests(array $headers, array $allowedDomains =
/**
* Data provider for testAllowedFormRequests().
*/
public function provideAllowedFormRequests(): array {
public static function provideAllowedFormRequests(): array {
return [
// Omitting the Origin and Apollo-Require-Preflight is allowed.
[['CONTENT_TYPE' => 'multipart/form-data']],
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/Framework/PersistedQueriesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function testPersistedQueries(array $instanceIds, string $queryId, array
/**
* Data provider for testPersistedQueries().
*/
public function persistedQueriesDataProvider(): array {
public static function persistedQueriesDataProvider(): array {
return [
// This is the most usual case, all the three plugins are enabled.
[
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/ResolverBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function testBuilderProducing($input, $expected): void {
/**
* @return array
*/
public function builderProducingProvider(): array {
public static function builderProducingProvider(): array {
return [
['entity_load', ResolverInterface::class],
['entity_id', ResolverInterface::class],
Expand Down

0 comments on commit 41bc902

Please sign in to comment.