Skip to content

Commit f4d5d54

Browse files
committed
fixed CI
1 parent 73299aa commit f4d5d54

File tree

9 files changed

+19
-88
lines changed

9 files changed

+19
-88
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
php-version: [7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4]
17-
#php-version: [5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4]
16+
php-version: [5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4]
1817
include:
1918
- php-version: nightly
2019
fail-fast: false
@@ -47,9 +46,6 @@ jobs:
4746
- name: Run tests (${{ matrix.php-version }})
4847
run: make test
4948

50-
- name: Run Docker tests
51-
run: docker run --rm test_phpmetrics
52-
5349
build:
5450
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/')
5551
needs: test

.travis.yml

Lines changed: 0 additions & 73 deletions
This file was deleted.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ include artifacts/Makefile
44

55
# Run unit tests
66
test:
7-
./vendor/bin/phpunit -c phpunit.xml.dist
7+
./vendor/bin/phpunit -c phpunit.xml.dist --exclude-group binary
88

99
# Compatibility check
1010
compatibility:

tests/Component/Issuer/IssuerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function testICanEnableIssuerPhp5(): void
3535
$this->assertStringContainsString('Details', $issuer->log);
3636
$this->assertStringContainsString('https://github.com/phpmetrics/PhpMetrics/issues/new', $output->output);
3737
$this->assertStringContainsString('Firstname: Jean-François', $issuer->log);
38-
$this->assertStringContainsString('IssuerTest.php (line 26)', $issuer->log);
38+
$this->assertStringContainsString('IssuerTest.php (line 29)', $issuer->log);
3939
$issuer->disable();
4040
}
4141

tests/Polyfill/TestCaseCompatible.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ trait TestCaseCompatible
77
{
88
public function assertStringContainsString($needle, $haystack, $message = '')
99
{
10-
$this->assertStringContainsString($needle, $haystack, $message);
10+
$this->assertContains($needle, $haystack, $message);
1111
}
1212

1313
public function assertMatchesRegularExpression($pattern, $string, $message = '')
1414
{
15-
$this->assertMatchesRegularExpression($pattern, $string, $message);
15+
$this->assertRegExp($pattern, $string, $message);
1616
}
1717
}
1818
} else {

tests/binary/BinTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<?php
22
namespace Test\Binary;
33

4+
use PHPUnit\Framework\Attributes\Group;
45
use Polyfill\TestCaseCompatible;
56

67
/**
78
* @group binary
89
*/
10+
#[Group('binary')]
911
class BinTest extends \PHPUnit\Framework\TestCase
1012
{
1113
use TestCaseCompatible;

tests/binary/PharTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<?php
22
namespace Test\Binary;
33

4+
use PHPUnit\Framework\Attributes\Group;
45
use Polyfill\TestCaseCompatible;
56

67
/**
78
* @group binary
89
*/
10+
#[Group('binary')]
911
class PharTest extends \PHPUnit\Framework\TestCase
1012
{
1113

tests/binary/ReportTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<?php
22
namespace Test\Binary;
33

4+
use PHPUnit\Framework\Attributes\Group;
45
use Polyfill\TestCaseCompatible;
56

67
/**
78
* @group binary
89
*/
10+
#[Group('binary')]
911
class BinReportTest extends \PHPUnit\Framework\TestCase
1012
{
1113
use TestCaseCompatible;

tests/binary/StandaloneTest.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,36 @@
11
<?php
22
namespace Test\Hal\binary;
33

4+
use PHPUnit\Framework\Attributes\Group;
45
use Polyfill\TestCaseCompatible;
56

67
/**
78
* @group binary
89
*/
10+
#[Group('binary')]
911
class StandaloneTest extends \PHPUnit\Framework\TestCase
1012
{
1113

1214
use TestCaseCompatible;
1315

14-
private $phar;
16+
private $binary;
1517

1618
public function setUp(): void
1719
{
1820
parent::setUp();
19-
$this->phar = __DIR__ . '/../../releases/phpmetrics-linux-x86_64';
21+
$this->binary = __DIR__ . '/../../releases/phpmetrics-linux-x86_64';
2022
}
2123

22-
public function testICanRunPhar(): void
24+
public function testICanRunStandaloneBinary(): void
2325
{
24-
$command = sprintf('%s --version', $this->phar);
26+
$command = sprintf('%s --version', $this->binary);
2527
$r = shell_exec($command);
2628
$this->assertStringContainsString('PhpMetrics', $r);
2729
}
2830

2931
public function testICanProvideOneDirectoryToParse(): void
3032
{
31-
$command = sprintf('%s --exclude="" %s 2>&1', $this->phar, __DIR__ . '/examples/1');
33+
$command = sprintf('%s --exclude="" %s 2>&1', $this->binary, __DIR__ . '/examples/1');
3234
$r = shell_exec($command);
3335
$this->assertStringContainsString('Object oriented programming', $r);
3436
$this->assertStringContainsString('LOC', $r);
@@ -39,7 +41,7 @@ public function testICanProvideMultipleDirectoriesToParse(): void
3941
{
4042
$command = sprintf(
4143
'%s --exclude="" %s,%s 2>&1',
42-
$this->phar,
44+
$this->binary,
4345
__DIR__ . '/examples/1',
4446
__DIR__ . '/examples/2'
4547
);

0 commit comments

Comments
 (0)