• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

JBZoo / Codestyle / 18063683129

27 Sep 2025 06:57PM UTC coverage: 80.896% (-6.8%) from 87.66%
18063683129

push

github

web-flow
test(ci): Update PHP versions and fix workflow tests (#54)

- Update PHP versions in CI workflows from 8.1-8.3 to 8.2-8.4.
- Remove the unnecessary scheduled CI job.
- Adjust `TraitGithubActions` to validate the updated workflow
configuration.
- Fix badge line formatting in `TraitReadme` test.

4 of 4 new or added lines in 2 files covered. (100.0%)

79 existing lines in 7 files now uncovered.

542 of 670 relevant lines covered (80.9%)

10.91 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/PHPUnit/AbstractPhpStormProxyTest.php
1
<?php
2

3
/**
4
 * JBZoo Toolbox - Codestyle.
5
 *
6
 * This file is part of the JBZoo Toolbox project.
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @license    MIT
11
 * @copyright  Copyright (C) JBZoo.com, All rights reserved.
12
 * @see        https://github.com/JBZoo/Codestyle
13
 */
14

15
declare(strict_types=1);
16

17
namespace JBZoo\Codestyle\PHPUnit;
18

19
use JBZoo\PHPUnit\PHPUnit;
20
use JBZoo\Utils\Cli;
21
use JBZoo\Utils\Env;
22

23
use function JBZoo\PHPUnit\isPhpStorm;
24
use function JBZoo\PHPUnit\skip;
25
use function JBZoo\PHPUnit\success;
26

27
/** @psalm-suppress UnusedClass */
28
abstract class AbstractPhpStormProxyTest extends PHPUnit
29
{
30
    public function testPhpCsFixerFix(): void
31
    {
UNCOV
32
        $this->runToolViaMakefile('test-phpcsfixer-fix');
×
33
    }
34

35
    /**
36
     * @depends testPhpCsFixerFix
37
     */
38
    public function testPhpCsFixerCheck(): void
39
    {
UNCOV
40
        $this->runToolViaMakefile('test-phpcsfixer-teamcity');
×
41
    }
42

43
    /**
44
     * @depends testPhpCsFixerCheck
45
     */
46
    public function testPhpCodeSniffer(): void
47
    {
UNCOV
48
        $this->runToolViaMakefile('test-phpcs-teamcity');
×
49
    }
50

51
    public function testPhpMessDetector(): void
52
    {
UNCOV
53
        $this->runToolViaMakefile('test-phpmd-teamcity');
×
54
    }
55

56
    public function testPhpMagicNumbers(): void
57
    {
UNCOV
58
        $this->runToolViaMakefile('test-phpmnd-teamcity');
×
59
    }
60

61
    /**
62
     * @depends testPhpCodeSniffer
63
     */
64
    public function testPhpStan(): void
65
    {
UNCOV
66
        $this->runToolViaMakefile('test-phpstan-teamcity');
×
67
    }
68

69
    /**
70
     * @depends testPhpStan
71
     */
72
    public function testPsalm(): void
73
    {
UNCOV
74
        $this->runToolViaMakefile('test-psalm-teamcity');
×
75
    }
76

77
    /**
78
     * @depends testPsalm
79
     */
80
    public function testPhan(): void
81
    {
UNCOV
82
        $this->runToolViaMakefile('test-phan-teamcity');
×
83
    }
84

85
    /**
86
     * Test works only in PhpStorm or TeamCity if variable PHPSTORM_PROXY=1
87
     * Please, use `make codestyle` for any other environments.
88
     */
89
    protected function runToolViaMakefile(string $makeTargetName): void
90
    {
UNCOV
91
        $testCaseEnvVariable = $this->getEnvVariableForTestCase($makeTargetName);
×
92

93
        if (
94
            isPhpStorm()
×
UNCOV
95
            && (Env::bool('PHPSTORM_PROXY') || Env::bool($testCaseEnvVariable))
×
96
        ) {
UNCOV
97
            $phpBin = Env::string('PHP_BIN', 'php');
×
98

UNCOV
99
            $cliCommand = \implode(' ', [
×
UNCOV
100
                'TC_REPORT="tc-tests"',
×
UNCOV
101
                'TC_REPORT_MND="tc-tests"',
×
102
                'TEAMCITY_VERSION="2020.1.2"',
×
103
                "PHP_BIN=\"{$phpBin}\"",
×
UNCOV
104
                "make {$makeTargetName}",
×
UNCOV
105
            ]);
×
106

107
            // Redirect error to std output
108
            try {
109
                Cli::out(\trim(Cli::exec($cliCommand, [], PROJECT_ROOT)));
×
110
            } catch (\Exception $exception) {
×
UNCOV
111
                Cli::out(\trim($exception->getMessage()));
×
112
            }
113
        } else {
UNCOV
114
            skip("Define env.PHPSTORM_PROXY=1 or env.{$testCaseEnvVariable}=1");
×
115
        }
116

UNCOV
117
        success();
×
118
    }
119

120
    /**
121
     * @suppress PhanPluginPossiblyStaticPrivateMethod
122
     */
123
    private function getEnvVariableForTestCase(string $makeTargetName): string
124
    {
125
        $makeTargetName = \str_replace(['test-', '-teamcity', '-'], ['', '', '_'], $makeTargetName);
×
UNCOV
126
        $makeTargetName = \strtoupper($makeTargetName);
×
127

UNCOV
128
        return "PHPSTORM_PROXY_{$makeTargetName}";
×
129
    }
130
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc