Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
timnolte committed Nov 13, 2023
1 parent ebda00a commit 6c2e5b2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/pr-unit-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ jobs:
run: docker compose -f docker-compose.ci.yml exec app /bin/bash -c 'composer install && composer phpunit'

- name: Shutdown Docker Environment
if: success() || failure()
run: docker compose -f docker-compose.ci.yml down

- name: Generate Coverage Report
if: success()
# https://github.com/marketplace/actions/coverage-report-as-comment-clover
uses: lucassabreu/comment-coverage-clover@main
with:
Expand Down
19 changes: 18 additions & 1 deletion tests/phpunit/openid-connect-generic_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ class OpenID_Connect_Generic_Test extends WP_UnitTestCase {
*/
private $oidc_plugin_settings = null;

/**
* @var int
*/
private $state_time_limit_default = 9999;

/**
* Test case setup method.
*
Expand All @@ -32,7 +37,7 @@ public function setUp(): void {
$this->oidc_plugin_settings = new OpenID_Connect_Generic_Option_Settings(
// Default settings values.
array(
'state_time_limit' => 9999
'state_time_limit' => $this->state_time_limit_default,
)
);

Expand Down Expand Up @@ -128,4 +133,16 @@ public function test_plugin_returns_valid_instance() {

}

/**
* Test plugin settings `state_time_limit` has a default.
*
* @group PluginTests
*/
public function test_plugin_settings_has_state_time_limit_default() {

$this->assertIsInt( $this->oidc_plugin_settings->state_time_limit, "The OpenID_Connect_Generic_Option_Settings `state_time_limit` value '{$this->oidc_plugin_settings->state_time_limit}' is not and integer or is not set." );
$this->assertEquals( $this->state_time_limit_default, $this->oidc_plugin_settings->state_time_limit, "The OpenID_Connect_Generic_Option_Settings `state_time_limit` default value '{$this->oidc_plugin_settings->state_time_limit}' is not '{$this->state_time_limit_default}'." );

}

}

0 comments on commit 6c2e5b2

Please sign in to comment.