Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
name: CI

on: [push, pull_request]
on:
pull_request:

jobs:
tests:
runs-on: ubuntu-latest

env:
COMPOSER_ROOT_VERSION: 4.99.99

strategy:
matrix:
php: [8.1, 8.2, 8.3, 8.4]
php: [8.2, 8.3, 8.4]

steps:
- name: Checkout code
Expand All @@ -21,6 +19,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: phpstan

- name: Validate composer.json and composer.lock
run: composer validate
Expand All @@ -30,3 +29,6 @@ jobs:

- name: Run test suite
run: php vendor/bin/codecept run

- name: Execute PHPStan
run: phpstan
61 changes: 61 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Automated release
on:
push:
branches:
- master
jobs:
tests:
runs-on: ubuntu-latest

strategy:
matrix:
php: [8.2, 8.3, 8.4]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: phpstan

- name: Validate composer.json and composer.lock
run: composer validate

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-interaction --no-suggest


- name: Run test suite
run: php vendor/bin/codecept run

- name: Execute PHPStan
run: phpstan
release:
name: Automated release
needs:
- tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 22
- run: >
npx
-p "@semantic-release/commit-analyzer"
-p "@semantic-release/release-notes-generator"
-p conventional-changelog-conventionalcommits
-p semantic-release
-- semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
packages: write
contents: write
pull-requests: write
11 changes: 11 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"branches": ["master"],
"tagFormat": "${version}",
"plugins": [
["@semantic-release/commit-analyzer", {
"preset": "conventionalcommits",
"presetConfig": {}
}],
"@semantic-release/github",
"@semantic-release/release-notes-generator"]
}
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
],
"homepage": "https://codeception.com/",
"require": {
"php": "^8.1",
"php": "^8.2",
"ext-dom": "*",
"ext-json": "*",
"ext-mbstring": "*",
"codeception/codeception": "^5.0.8",
"codeception/lib-web": "^1.0.1",
"phpunit/phpunit": "^10.0 || ^11.0 || ^12.0",
"phpunit/phpunit": "^11.5 || ^12.0",
"symfony/browser-kit": "^4.4.24 || ^5.4 || ^6.0 || ^7.0",
"symfony/dom-crawler": "^4.4.30 || ^5.4 || ^6.0 || ^7.0"
},
Expand Down
5 changes: 5 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
parameters:
paths:
- ./src
- ./tests
level: 1
8 changes: 0 additions & 8 deletions src/Codeception/Lib/Framework.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@
*/
abstract class Framework extends InnerBrowser
{
/**
* Returns a list of recognized domain names
*/
protected function getInternalDomains(): array
{
return [];
}

public function _beforeSuite($settings = [])
{
/**
Expand Down
9 changes: 9 additions & 0 deletions src/Codeception/Lib/InnerBrowser.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@
protected function isInternalDomain(string $domain): bool
{
if ($this->internalDomains === null) {

$this->internalDomains = $this->getInternalDomains();
}

Expand All @@ -260,6 +261,14 @@
return false;
}

/**
* Returns a list of recognized domain names
*/
protected function getInternalDomains(): array
{
return [];
}

/**
* Opens a page with arbitrary request parameters.
* Useful for testing multi-step forms on a specific step.
Expand Down Expand Up @@ -802,7 +811,7 @@
return $values;
}

$this->fail("Element {$nodes} is not a form field or does not contain a form field");

Check failure on line 814 in src/Codeception/Lib/InnerBrowser.php

View workflow job for this annotation

GitHub Actions / tests (8.3)

Method Codeception\Lib\InnerBrowser::getValueAndTextFromField() should return array|string but return statement is missing.

Check failure on line 814 in src/Codeception/Lib/InnerBrowser.php

View workflow job for this annotation

GitHub Actions / tests (8.4)

Method Codeception\Lib\InnerBrowser::getValueAndTextFromField() should return array|string but return statement is missing.

Check failure on line 814 in src/Codeception/Lib/InnerBrowser.php

View workflow job for this annotation

GitHub Actions / tests (8.2)

Method Codeception\Lib\InnerBrowser::getValueAndTextFromField() should return array|string but return statement is missing.
}

/**
Expand Down Expand Up @@ -1539,7 +1548,7 @@
return $values;
}

$this->fail("Element {$nodes} is not a form field or does not contain a form field");

Check failure on line 1551 in src/Codeception/Lib/InnerBrowser.php

View workflow job for this annotation

GitHub Actions / tests (8.3)

Method Codeception\Lib\InnerBrowser::grabValueFrom() should return mixed but return statement is missing.

Check failure on line 1551 in src/Codeception/Lib/InnerBrowser.php

View workflow job for this annotation

GitHub Actions / tests (8.4)

Method Codeception\Lib\InnerBrowser::grabValueFrom() should return mixed but return statement is missing.

Check failure on line 1551 in src/Codeception/Lib/InnerBrowser.php

View workflow job for this annotation

GitHub Actions / tests (8.2)

Method Codeception\Lib\InnerBrowser::grabValueFrom() should return mixed but return statement is missing.
}

public function setCookie($name, $val, $params = [])
Expand Down
Loading