-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for
Admin_Settings::get_instance()
. (#230)
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
tests/phpunit/tests/AdminSettings/AdminSettings_GetInstanceTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
/** | ||
* Class AdminSettings_GetInstanceTest | ||
* | ||
* @package AspireUpdate | ||
*/ | ||
|
||
/** | ||
* Tests for Admin_Settings::get_instance() | ||
* | ||
* These tests rely on the method not being called during earlier test runs. | ||
* They must run in separate processes and must not preserve global state. | ||
* | ||
* @runTestsInSeparateProcesses | ||
* @preserveGlobalState disabled | ||
* | ||
* @covers \AspireUpdate\Admin_Settings::get_instance | ||
*/ | ||
class AdminSettings_GetInstanceTest extends AdminSettings_UnitTestCase { | ||
/** | ||
* Test that the same instance is retrieved. | ||
*/ | ||
public function test_should_get_the_same_instance() { | ||
$this->assertSame( | ||
AspireUpdate\Admin_Settings::get_instance(), | ||
AspireUpdate\Admin_Settings::get_instance() | ||
); | ||
} | ||
} |