Tests fail with "This test did not perform any assertions"
The following test definition fails with: This test did not perform any assertions
<?php
namespace My\SmokeTests;
use weitzman\DrupalTestTraits\ExistingSiteWebDriverTestBase;
/**
* Tests for verifying basic functionality.
*/
class SmokeTest extends ExistingSiteWebDriverTestBase {
/**
* Confirms the home page loads.
*/
public function testHomepageLoads() {
$assert_session = $this->assertSession();
$this->drupalGet('<front>');
$assert_session->statusCodeEquals(200);
}
}
I would have expected here that the status code check performs an assertion (and under the hood it does). Is there any way to ensure that PHPUnit treats tests like these as proper tests.
My workaround is to do:
public function setUp() {
parent::setUp();
$this->assertTrue(TRUE);
}
Maybe this could be done in one of the base classes if there's no other way to tell PHPUnit that assertions are occurring?