Skip to content

Commit

Permalink
Merge pull request #6299 from TavoNiievez/4.1
Browse files Browse the repository at this point in the history
Fix CI
  • Loading branch information
Naktibalda committed Dec 21, 2021
2 parents bd05fe0 + 2145016 commit e410e77
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Expand Up @@ -13,6 +13,7 @@ jobs:
env:
extensions: curl, mbstring, openssl, pdo, pdo_sqlite
SYMFONY_DEPRECATIONS_HELPER: weak
COMPOSER_ROOT_VERSION: 4.1

runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -82,6 +83,7 @@ jobs:
env:
extensions: curl, mbstring, openssl, pdo, pdo_sqlite
SYMFONY_DEPRECATIONS_HELPER: weak
COMPOSER_ROOT_VERSION: 4.1

runs-on: ${{ matrix.os }}

Expand Down
1 change: 0 additions & 1 deletion composer.json
Expand Up @@ -36,7 +36,6 @@
"squizlabs/php_codesniffer": "~2.0",
"vlucas/phpdotenv": "^2.0 | ^3.0 | ^4.0 | ^5.0",
"symfony/process": ">=2.7 <6.0",
"codeception/lib-innerbrowser": "^1.0 | 2.0.*@dev",
"codeception/module-asserts": "^1.0 | 2.0.*@dev",
"codeception/module-cli": "^1.0 | 2.0.*@dev",
"codeception/module-db": "^1.0 | 2.0.*@dev",
Expand Down
6 changes: 5 additions & 1 deletion tests/cli/BuildCest.php
Expand Up @@ -29,7 +29,11 @@ public function buildsActionsForAClass(CliGuy $I)
$I->seeInThisFile('use _generated\CliGuyActions');
$I->seeFileFound('CliGuyActions.php', 'tests/support/_generated');
$I->seeInThisFile('seeFileFound(');
$I->seeInThisFile('public function assertEquals($expected, $actual, $message = "") {');
if (PHP_VERSION_ID < 70400) {
$I->seeInThisFile('public function assertEquals($expected, $actual, $message = "") {');
} else {
$I->seeInThisFile('public function assertEquals($expected, $actual, string $message = "") {');
}
}

public function usesTypehintsWherePossible(CliGuy $I, Scenario $scenario)
Expand Down
4 changes: 2 additions & 2 deletions tests/coverage/LocalCept.php
Expand Up @@ -2,11 +2,11 @@
$I = new CoverGuy($scenario);
$I->wantTo('run local code coverage for cest and test');
$I->amInPath('tests/data/sandbox');
$I->executeCommand('run math MathTest --coverage', null, '-d pcov.directory=' . getcwd());
$I->executeCommand('run math MathTest --coverage', false, '-d pcov.directory=' . getcwd());
$I->seeInShellOutput('Classes: 100.00%');
$I->seeInShellOutput('Methods: 100.00%');

$I->amGoingTo('run local codecoverage in cest');
$I->executeCommand('run math MathCest --coverage', null, '-d pcov.directory=' . getcwd());
$I->executeCommand('run math MathCest --coverage', false, '-d pcov.directory=' . getcwd());
$I->seeInShellOutput('Classes: 100.00%');
$I->seeInShellOutput('Methods: 100.00%');
4 changes: 2 additions & 2 deletions tests/data/snapshots/codeception.yml
Expand Up @@ -14,8 +14,8 @@ suites:
- Asserts
- Db:
dsn: sqlite:tests/_data/snapshot_test.db
user:
password:
user: ''
password: ''

actor_suffix: Tester
extensions:
Expand Down
12 changes: 9 additions & 3 deletions tests/unit/Codeception/Command/BuildTest.php
Expand Up @@ -26,9 +26,15 @@ public function testBuild()

$this->content = $this->log[0]['content'];
// methods from Filesystem module
$this->assertStringContainsString('public function amInPath($path)', $this->content);
$this->assertStringContainsString('public function copyDir($src, $dst)', $this->content);
$this->assertStringContainsString('public function seeInThisFile($text)', $this->content);
if (PHP_VERSION_ID < 70400) {
$this->assertStringContainsString('public function amInPath($path)', $this->content);
$this->assertStringContainsString('public function copyDir($src, $dst)', $this->content);
$this->assertStringContainsString('public function seeInThisFile($text)', $this->content);
} else {
$this->assertStringContainsString('public function amInPath(string $path): void', $this->content);
$this->assertStringContainsString('public function copyDir(string $src, string $dst): void', $this->content);
$this->assertStringContainsString('public function seeInThisFile(string $text): void', $this->content);
}

// methods from EmulateHelper
$this->assertStringContainsString('public function seeEquals($expected, $actual)', $this->content);
Expand Down

0 comments on commit e410e77

Please sign in to comment.