diff --git a/.github/workflows/continous-integration.yml b/.github/workflows/continous-integration.yml index 4bef3ad..3bd1b99 100644 --- a/.github/workflows/continous-integration.yml +++ b/.github/workflows/continous-integration.yml @@ -56,7 +56,7 @@ jobs: codeception/module-phpbrowser:* \ codeception/module-webdriver:* \ wp-cli/wp-cli-bundle \ - lucatume/wp-browser:^4 + "lucatume/wp-browser:>3.1 <3.5" \ - name: Run Codeception Tests w/ Docker. env: diff --git a/codeception.dist.yml b/codeception.dist.yml index ab79232..0b895ef 100644 --- a/codeception.dist.yml +++ b/codeception.dist.yml @@ -18,13 +18,13 @@ extensions: enabled: - Codeception\Extension\RunFailed commands: - - "lucatume\\WPBrowser\\Command\\GenerateWPUnit" - - "lucatume\\WPBrowser\\Command\\GenerateWPRestApi" - - "lucatume\\WPBrowser\\Command\\GenerateWPRestController" - - "lucatume\\WPBrowser\\Command\\GenerateWPRestPostTypeController" - - "lucatume\\WPBrowser\\Command\\GenerateWPAjax" - - "lucatume\\WPBrowser\\Command\\GenerateWPCanonical" - - "lucatume\\WPBrowser\\Command\\GenerateWPXMLRPC" + - Codeception\Command\GenerateWPUnit + - Codeception\Command\GenerateWPRestApi + - Codeception\Command\GenerateWPRestController + - Codeception\Command\GenerateWPRestPostTypeController + - Codeception\Command\GenerateWPAjax + - Codeception\Command\GenerateWPCanonical + - Codeception\Command\GenerateWPXMLRPC params: - .env.testing - .env.docker \ No newline at end of file diff --git a/src/Codeception/Module/WPGraphQL.php b/src/Codeception/Module/WPGraphQL.php index 74f5545..4646361 100644 --- a/src/Codeception/Module/WPGraphQL.php +++ b/src/Codeception/Module/WPGraphQL.php @@ -17,12 +17,12 @@ class WPGraphQL extends Module { /** * @var array */ - protected array $config = [ + protected $config = [ 'endpoint' => '', 'auth_header' => '', ]; - protected array $requiredFields = [ + protected $requiredFields = [ 'endpoint', ]; @@ -109,7 +109,7 @@ protected function parseRequestOptions( array $selected_options ) { * Sends a GET request to the GraphQL endpoint and returns a response * * @param string $query The GraphQL query to send. - * @param array $selected_options Selected options to control various aspects of a request. + * @param ?array $selected_options Selected options to control various aspects of a request. * * @throws \Codeception\Exception\ModuleException Invalid endpoint | Invalid query. * @@ -145,7 +145,7 @@ public function getRawRequest( string $query, array $selected_options = [] ) { * Sends a GET request to the GraphQL endpoint and returns the query results * * @param string $query The GraphQL query to send. - * @param array $selected_options Selected options to control various aspects of a request. + * @param ?array $selected_options Selected options to control various aspects of a request. * * @throws \Codeception\Exception\ModuleException Invalid response | Empty response. * diff --git a/tests/codeception/acceptance.suite.dist.yml b/tests/codeception/acceptance.suite.dist.yml index 36e1588..8f4f72f 100644 --- a/tests/codeception/acceptance.suite.dist.yml +++ b/tests/codeception/acceptance.suite.dist.yml @@ -8,11 +8,11 @@ actor: AcceptanceTester modules: enabled: - - \lucatume\WPBrowser\Module\WPDb - - \lucatume\WPBrowser\Module\WPBrowser + - WPDb + - WPBrowser - \Helper\Acceptance config: - \lucatume\WPBrowser\Module\WPDb: + WPDb: dsn: '%TEST_SITE_DB_DSN%' user: '%TEST_DB_USER%' password: '%TEST_DB_PASSWORD%' @@ -24,7 +24,7 @@ modules: urlReplacement: true tablePrefix: '%TEST_TABLE_PREFIX%' - \lucatume\WPBrowser\Module\WPBrowser: + WPBrowser: url: '%TEST_SITE_WP_URL%' wpRootFolder: '%WP_ROOT_FOLDER%' adminUsername: '%TEST_SITE_ADMIN_USERNAME%' diff --git a/tests/codeception/functional.suite.dist.yml b/tests/codeception/functional.suite.dist.yml index 04ec111..95e03b4 100644 --- a/tests/codeception/functional.suite.dist.yml +++ b/tests/codeception/functional.suite.dist.yml @@ -7,9 +7,9 @@ actor: FunctionalTester modules: enabled: - Asserts - - \lucatume\WPBrowser\Module\WPDb - - \lucatume\WPBrowser\Module\WPBrowser - - \lucatume\WPBrowser\Module\WPFilesystem + - WPDb + - WPBrowser + - WPFilesystem - \Tests\WPGraphQL\Codeception\Module\QueryAsserts - \Tests\WPGraphQL\Codeception\Module\WPGraphQL - \Helper\Functional @@ -17,7 +17,7 @@ modules: \Tests\WPGraphQL\Codeception\Module\WPGraphQL: endpoint: '%TEST_SITE_WP_URL%/graphql' auth_header: 'Basic %TEST_SITE_ADMIN_APP_PASSWORD%' - \lucatume\WPBrowser\Module\WPDb: + WPDb: dsn: '%TEST_SITE_DB_DSN%' user: '%TEST_DB_USER%' password: '%TEST_DB_PASSWORD%' @@ -29,14 +29,14 @@ modules: urlReplacement: true tablePrefix: '%TEST_TABLE_PREFIX%' - \lucatume\WPBrowser\Module\WPBrowser: + WPBrowser: url: '%TEST_SITE_WP_URL%' wpRootFolder: '%WP_ROOT_FOLDER%' adminUsername: '%TEST_SITE_ADMIN_USERNAME%' adminPassword: '%TEST_SITE_ADMIN_PASSWORD%' adminPath: '/wp-admin' - \lucatume\WPBrowser\Module\WPFilesystem: + WPFilesystem: wpRootFolder: '%WP_ROOT_FOLDER%' plugins: '/wp-content/plugins' mu-plugins: '/wp-content/mu-plugins' diff --git a/tests/codeception/wpunit.suite.dist.yml b/tests/codeception/wpunit.suite.dist.yml index f1703b5..c93f443 100644 --- a/tests/codeception/wpunit.suite.dist.yml +++ b/tests/codeception/wpunit.suite.dist.yml @@ -5,10 +5,10 @@ actor: WpunitTester modules: enabled: - - \lucatume\WPBrowser\Module\WPLoader + - WPLoader - \Helper\Wpunit config: - \lucatume\WPBrowser\Module\WPLoader: + WPLoader: wpRootFolder: "%WP_ROOT_FOLDER%" dbName: "%TEST_DB_NAME%" dbHost: "%TEST_DB_HOST%"