Skip to content

Commit 469081a

Browse files
authored
Merge pull request #52 from humanmade/fix-tests
Fix tests
2 parents 12d9f24 + 26cecf2 commit 469081a

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ install:
77
- npm install
88

99
script:
10-
- phpunit
10+
- vendor/bin/phpunit

HM/bootstrap.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,6 @@ function attach_to_runner( $runner ) {
9090
}
9191
}
9292

93-
attach_to_runner( $GLOBALS['runner'] );
93+
if ( ! empty( $GLOBALS['runner'] ) ) {
94+
attach_to_runner( $GLOBALS['runner'] );
95+
}

tests/FixtureTests.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ public function test_passing_files( $file ) {
6464
$phpcsFile = new LocalFile( $file, $this->ruleset, $this->config );
6565
$phpcsFile->process();
6666

67+
$rel_file = substr( $file, strlen( __DIR__ ) );
6768
$foundErrors = $phpcsFile->getErrors();
68-
$this->assertEquals( [], $foundErrors, 'File should not contain any errors' );
69+
$this->assertEquals( [], $foundErrors, sprintf( 'File %s should not contain any errors', $rel_file ) );
6970
$foundWarnings = $phpcsFile->getWarnings();
70-
$this->assertEquals( [], $foundWarnings, 'File should not contain any warnings' );
71+
$this->assertEquals( [], $foundWarnings, sprintf( 'File %s should not contain any warnings', $rel_file ) );
7172
}
7273

7374
/**

tests/fixtures/pass/inc/namespace.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ function anonymous_function() {
2929

3030
return function () use ( $x ) {
3131
$x++;
32-
return $x;
32+
return new WP_Post( $x );
3333
};
3434
}

0 commit comments

Comments
 (0)