Skip to content

Commit

Permalink
Merge pull request #251 from Automattic/fix-various-tests
Browse files Browse the repository at this point in the history
Fix PHPCS and support-level related tests
  • Loading branch information
gudmdharalds authored Feb 23, 2022
2 parents 072e1ba + d3ea2fa commit c6dd489
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ final class PhpcsScanValidateSniffsInOptionAndReportTest extends TestCase {
'phpcs-path'
=> null,

'phpcs-php-path'
=> null,

'phpcs-standard'
=> null,

Expand Down Expand Up @@ -66,6 +69,8 @@ protected function setUp(): void {

$this->options['branches-ignore'] = array();

$this->options['phpcs'] = true;

$this->options['phpcs-sniffs-include'] = array();
$this->options['phpcs-sniffs-exclude'] = array();

Expand Down
10 changes: 10 additions & 0 deletions tests/integration/SupportLevelLabelMetaApiDataFetchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ protected function setUp(): void {
);

$this->options = $this->options_meta_api_secrets;

// This can be an empty string, set to empty if null.
if ( null === $this->options['repo-meta-api-user-id'] ) {
$this->options['repo-meta-api-user-id'] = '';
}

// This can be an empty string, set to empty if null.
if ( null === $this->options['repo-meta-api-access-token'] ) {
$this->options['repo-meta-api-access-token'] = '';
}
}

protected function tearDown(): void {
Expand Down
10 changes: 10 additions & 0 deletions tests/integration/SupportLevelLabelRepoMetaApiDataMatchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ protected function setUp(): void {
);

$this->options['branches-ignore'] = array();

// This can be an empty string, set to empty if null.
if ( null === $this->options['repo-meta-api-user-id'] ) {
$this->options['repo-meta-api-user-id'] = '';
}

// This can be an empty string, set to empty if null.
if ( null === $this->options['repo-meta-api-access-token'] ) {
$this->options['repo-meta-api-access-token'] = '';
}
}

protected function tearDown(): void {
Expand Down
12 changes: 11 additions & 1 deletion tests/integration/SupportLevelLabelSetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ protected function setUp(): void {
'[MySupport Level]';

$this->options['skip-draft-prs'] = false;

// This can be an empty string, set to empty if null.
if ( null === $this->options['repo-meta-api-user-id'] ) {
$this->options['repo-meta-api-user-id'] = '';
}

// This can be an empty string, set to empty if null.
if ( null === $this->options['repo-meta-api-access-token'] ) {
$this->options['repo-meta-api-access-token'] = '';
}
}

protected function tearDown(): void {
Expand Down Expand Up @@ -186,7 +196,7 @@ public function testSupportLevelSet2() {
0,
$support_labels_cnt
);

/*
* Attempt to set support level label.
*/
Expand Down

0 comments on commit c6dd489

Please sign in to comment.