Skip to content
Snippets Groups Projects
Commit 6452d2c0 authored by Tim Plunkett's avatar Tim Plunkett
Browse files

Issue #3351137 by tim.plunkett: Update tests for compatibility with phpstan/phpstan-phpunit

parent 54ac8e8b
No related branches found
No related tags found
No related merge requests found
......@@ -152,7 +152,7 @@ class InstallerControllerTest extends BrowserTestBase {
/**
* Confirms a require will stop if package already present.
*
* @covers::require
* @covers ::require
*/
public function testInstallAlreadyPresentPackage() {
$this->assertProjectBrowserTempStatus(NULL, NULL);
......@@ -169,7 +169,7 @@ class InstallerControllerTest extends BrowserTestBase {
/**
* Calls the endpoint that begins installation.
*
* @covers::begin
* @covers ::begin
*/
private function doStart() {
$this->assertProjectBrowserTempStatus(NULL, NULL);
......@@ -184,7 +184,7 @@ class InstallerControllerTest extends BrowserTestBase {
/**
* Calls the endpoint that continues to the require phase of installation.
*
* @covers::require
* @covers ::require
*/
private function doRequire() {
$this->drupalGet("/admin/modules/project_browser/install-require/drupal/awesome_module/$this->stageId");
......@@ -196,7 +196,7 @@ class InstallerControllerTest extends BrowserTestBase {
/**
* Calls the endpoint that continues to the apply phase of installation.
*
* @covers::apply
* @covers ::apply
*/
private function doApply() {
$this->drupalGet("/admin/modules/project_browser/install-apply/drupal/awesome_module/$this->stageId");
......@@ -208,7 +208,7 @@ class InstallerControllerTest extends BrowserTestBase {
/**
* Calls the endpoint that continues to the post apply phase of installation.
*
* @covers::postApply
* @covers ::postApply
*/
private function doPostApply() {
$this->drupalGet("/admin/modules/project_browser/install-post_apply/drupal/awesome_module/$this->stageId");
......@@ -220,7 +220,7 @@ class InstallerControllerTest extends BrowserTestBase {
/**
* Calls the endpoint that continues to the destroy phase of installation.
*
* @covers::destroy
* @covers ::destroy
*/
private function doDestroy() {
$this->drupalGet("/admin/modules/project_browser/install-destroy/drupal/awesome_module/$this->stageId");
......@@ -243,7 +243,7 @@ class InstallerControllerTest extends BrowserTestBase {
/**
* Tests an error during a pre create event.
*
* @covers::create
* @covers ::create
*/
public function testPreCreateError() {
$message = t('This is a PreCreate error.');
......@@ -257,7 +257,7 @@ class InstallerControllerTest extends BrowserTestBase {
/**
* Tests an exception during a pre create event.
*
* @covers::create
* @covers ::create
*/
public function testPreCreateException() {
$error = new \Exception('PreCreate did not go well.');
......@@ -270,7 +270,7 @@ class InstallerControllerTest extends BrowserTestBase {
/**
* Tests an exception during a post create event.
*
* @covers::create
* @covers ::create
*/
public function testPostCreateException() {
$error = new \Exception('PostCreate did not go well.');
......@@ -283,7 +283,7 @@ class InstallerControllerTest extends BrowserTestBase {
/**
* Tests an error during a pre require event.
*
* @covers::require
* @covers ::require
*/
public function testPreRequireError() {
$message = t('This is a PreRequire error.');
......@@ -298,7 +298,7 @@ class InstallerControllerTest extends BrowserTestBase {
/**
* Tests an exception during a pre require event.
*
* @covers::require
* @covers ::require
*/
public function testPreRequireException() {
$error = new \Exception('PreRequire did not go well.');
......@@ -312,7 +312,7 @@ class InstallerControllerTest extends BrowserTestBase {
/**
* Tests an exception during a post require event.
*
* @covers::require
* @covers ::require
*/
public function testPostRequireException() {
$error = new \Exception('PostRequire did not go well.');
......@@ -326,7 +326,7 @@ class InstallerControllerTest extends BrowserTestBase {
/**
* Tests an error during a pre apply event.
*
* @covers::apply
* @covers ::apply
*/
public function testPreApplyError() {
$message = t('This is a PreApply error.');
......@@ -342,7 +342,7 @@ class InstallerControllerTest extends BrowserTestBase {
/**
* Tests an exception during a pre apply event.
*
* @covers::apply
* @covers ::apply
*/
public function testPreApplyException() {
$error = new \Exception('PreApply did not go well.');
......@@ -357,7 +357,7 @@ class InstallerControllerTest extends BrowserTestBase {
/**
* Tests an exception during a post apply event.
*
* @covers::apply
* @covers ::apply
*/
public function testPostApplyException() {
$error = new \Exception('PostApply did not go well.');
......@@ -373,7 +373,7 @@ class InstallerControllerTest extends BrowserTestBase {
/**
* Tests an error during a pre destroy event.
*
* @covers::destroy
* @covers ::destroy
*/
public function testPreDestroyError() {
$message = t('This is a PreDestroy error.');
......@@ -391,7 +391,7 @@ class InstallerControllerTest extends BrowserTestBase {
/**
* Tests an exception during a pre destroy event.
*
* @covers::destroy
* @covers ::destroy
*/
public function testPreDestroyException() {
$error = new \Exception('PreDestroy did not go well.');
......@@ -408,7 +408,7 @@ class InstallerControllerTest extends BrowserTestBase {
/**
* Tests an exception during a post destroy event.
*
* @covers::destroy
* @covers ::destroy
*/
public function testPostDestroyException() {
$error = new \Exception('PostDestroy did not go well.');
......@@ -425,7 +425,7 @@ class InstallerControllerTest extends BrowserTestBase {
/**
* Confirms the various versions of the "install in progress" messages.
*
* @covers::unlock
* @covers ::unlock
*/
public function testInstallUnlockMessage() {
$this->doStart();
......@@ -471,7 +471,7 @@ class InstallerControllerTest extends BrowserTestBase {
*
* The break lock link is not available once the stage is applying.
*
* @covers::unlock
* @covers ::unlock
*/
public function testCanBreakLock() {
$this->doStart();
......@@ -496,7 +496,7 @@ class InstallerControllerTest extends BrowserTestBase {
/**
* Confirms stage can be unlocked despite a missing Project Browser lock.
*
* @covers::unlock
* @covers ::unlock
*/
public function testCanBreakStageWithMissingProjectBrowserLock() {
$this->doStart();
......@@ -520,7 +520,7 @@ class InstallerControllerTest extends BrowserTestBase {
/**
* Confirm a module and its dependencies can be installed via the endpoint.
*
* @covers::activateModule
* @covers ::activateModule
*/
public function testCoreModuleActivate() {
$this->drupalGet('admin/modules');
......
......@@ -8,6 +8,8 @@ use Drupal\Tests\project_browser\Traits\PackageManagerFixtureUtilityTrait;
/**
* Provides tests for the Project Browser Installer UI.
*
* @coversDefaultClass \Drupal\project_browser\Controller\InstallerController
*
* @group project_browser
*/
class ProjectBrowserInstallerUiTest extends WebDriverTestBase {
......@@ -133,7 +135,7 @@ class ProjectBrowserInstallerUiTest extends WebDriverTestBase {
/**
* Confirms stage can be unlocked despite a missing Project Browser lock.
*
* @covers::unlock
* @covers ::unlock
*/
public function testCanBreakStageWithMissingProjectBrowserLock() {
$assert_session = $this->assertSession();
......@@ -169,7 +171,7 @@ class ProjectBrowserInstallerUiTest extends WebDriverTestBase {
*
* The break lock link is not available once the stage is applying.
*
* @covers::unlock
* @covers ::unlock
*/
public function testCanBreakLock() {
$assert_session = $this->assertSession();
......
......@@ -8,7 +8,7 @@ use Drupal\project_browser\ProjectBrowser\Project;
/**
* Tests 'Core (Experimental)' label change.
*
* @covers \Drupal\project_browser\Plugin\ProjectBrowserSource\DrupalCore::projectIsCovered
* @coversDefaultClass \Drupal\project_browser\Plugin\ProjectBrowserSource\DrupalCore
*
* @group project_browser
*/
......@@ -30,6 +30,8 @@ class CoreExperimentalLabelTest extends KernelTestBase {
* to another module that is currently experimental. If it's reason 3,
* we need to update `DrupalCore::projectIsCovered` to look for the new
* language that indicates a module is experimental.
*
* @covers ::getProjectData
*/
public function testCoreExperimentalLabel(): void {
/** @var \Drupal\project_browser\Plugin\ProjectBrowserSourceInterface $plugin_instance */
......
......@@ -62,6 +62,8 @@ class MockDrupalDotOrgTest extends UnitTestCase {
* {@inheritdoc}
*/
protected function setUp(): void {
parent::setUp();
$this->logger = $this->createMock(LoggerInterface::class);
$this->database = $this->createMock(Connection::class);
$this->httpClient = $this->createMock(ClientInterface::class);
......
......@@ -21,7 +21,7 @@ use org\bovigo\vfs\vfsStream;
class ProjectBrowserFixtureHelperTest extends UnitTestCase {
/**
* @covers populateFromFixture
* @covers ::populateFromFixture
*/
public function testPopulateFromFixture(): void {
vfsStream::setup('root');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment