Skip to content

Commit

Permalink
Update tests to fail if exception not hit
Browse files Browse the repository at this point in the history
  • Loading branch information
Sephster committed Oct 11, 2024
1 parent 238a787 commit e88f89d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions tests/Grant/AuthCodeGrantTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,7 @@ public function testValidateAuthorizationRequestInvalidScopes(): void
return;
}

$this->expectException(OAuthServerException::class);
$this->expectExceptionCode(5);
$this->fail('The expected exception was not thrown');

Check failure on line 512 in tests/Grant/AuthCodeGrantTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-stable, ubuntu-latest)

Dynamic call to static method PHPUnit\Framework\Assert::fail().

Check failure on line 512 in tests/Grant/AuthCodeGrantTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-lowest, ubuntu-latest)

Dynamic call to static method PHPUnit\Framework\Assert::fail().

Check failure on line 512 in tests/Grant/AuthCodeGrantTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-lowest, ubuntu-latest)

Dynamic call to static method PHPUnit\Framework\Assert::fail().

Check failure on line 512 in tests/Grant/AuthCodeGrantTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-stable, ubuntu-latest)

Dynamic call to static method PHPUnit\Framework\Assert::fail().
}

public function testCompleteAuthorizationRequest(): void
Expand Down Expand Up @@ -595,8 +594,7 @@ public function testCompleteAuthorizationRequestDenied(): void
return;
}

$this->expectException(OAuthServerException::class);
$this->expectExceptionCode(9);
$this->fail('The expected exception was not thrown');

Check failure on line 597 in tests/Grant/AuthCodeGrantTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-stable, ubuntu-latest)

Dynamic call to static method PHPUnit\Framework\Assert::fail().

Check failure on line 597 in tests/Grant/AuthCodeGrantTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-lowest, ubuntu-latest)

Dynamic call to static method PHPUnit\Framework\Assert::fail().

Check failure on line 597 in tests/Grant/AuthCodeGrantTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-lowest, ubuntu-latest)

Dynamic call to static method PHPUnit\Framework\Assert::fail().

Check failure on line 597 in tests/Grant/AuthCodeGrantTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-stable, ubuntu-latest)

Dynamic call to static method PHPUnit\Framework\Assert::fail().
}

public function testRespondToAccessTokenRequest(): void
Expand Down
6 changes: 2 additions & 4 deletions tests/Grant/ImplicitGrantTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,7 @@ public function testValidateAuthorizationRequestInvalidScopes(): void
return;
}

$this->expectException(OAuthServerException::class);
$this->expectExceptionCode(5);
$this->fail('Did not throw expected exception');

Check failure on line 244 in tests/Grant/ImplicitGrantTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-stable, ubuntu-latest)

Dynamic call to static method PHPUnit\Framework\Assert::fail().

Check failure on line 244 in tests/Grant/ImplicitGrantTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-lowest, ubuntu-latest)

Dynamic call to static method PHPUnit\Framework\Assert::fail().

Check failure on line 244 in tests/Grant/ImplicitGrantTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-lowest, ubuntu-latest)

Dynamic call to static method PHPUnit\Framework\Assert::fail().

Check failure on line 244 in tests/Grant/ImplicitGrantTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-stable, ubuntu-latest)

Dynamic call to static method PHPUnit\Framework\Assert::fail().
}

public function testCompleteAuthorizationRequest(): void
Expand Down Expand Up @@ -311,8 +310,7 @@ public function testCompleteAuthorizationRequestDenied(): void
return;
}

$this->expectException(OAuthServerException::class);
$this->expectExceptionCode(9);
$this->fail('Did not throw expected exception');

Check failure on line 313 in tests/Grant/ImplicitGrantTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-stable, ubuntu-latest)

Dynamic call to static method PHPUnit\Framework\Assert::fail().

Check failure on line 313 in tests/Grant/ImplicitGrantTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-lowest, ubuntu-latest)

Dynamic call to static method PHPUnit\Framework\Assert::fail().

Check failure on line 313 in tests/Grant/ImplicitGrantTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-lowest, ubuntu-latest)

Dynamic call to static method PHPUnit\Framework\Assert::fail().

Check failure on line 313 in tests/Grant/ImplicitGrantTest.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-stable, ubuntu-latest)

Dynamic call to static method PHPUnit\Framework\Assert::fail().
}

public function testAccessTokenRepositoryUniqueConstraintCheck(): void
Expand Down

0 comments on commit e88f89d

Please sign in to comment.