vscode-phpunit icon indicating copy to clipboard operation
vscode-phpunit copied to clipboard

Code Lens no longer present following test containing HEREDOC code

Open gwythan opened this issue 3 years ago • 0 comments

If you write a test containing HEREDOC code, PHPUnit Test Explorer stops displaying Code Lens controls on every test following this one.

Reproduce with:

<?php

use PHPUnit\Framework\TestCase;

class DebugTest extends TestCase
{
	protected function setUp(): void
	{
		parent::setUp();
	}

	protected function tearDown(): void
	{
		parent::tearDown();
	}

	public function __construct()
	{
		parent::__construct();
	}

	public function testBefore()
	{
		$this->markTestSkipped();
	}


	public function testParseMinimalVEventObject(): void
	{
		$str = <<<EOD
			Example of string
			spanning multiple lines
			using heredoc syntax.
		EOD;


		$this->$this->markTestIncomplete('Got a HEREDOC here');
	}

	public function testDontSeeCodeLens(): void
	{
		$this->markTestSkipped();
	}


	public function testCodeLensMissingHereToo(): void
	{
		$this->markTestSkipped();
	}
}

See attached screenshot for the result (formatted tightly so you can see the whole screen) PHPUnit Test Explorer .

These 'HEREDOC' test run just fine using phpunit from the terminal command line.

gwythan avatar May 03 '21 16:05 gwythan