"value":"\n <p>In PHPUnit, there are different ways to write test methods.<\/p>\n\n<p>The standard way is to use camel-case method names with a <code>test<\/code> prefix, for example:<\/p>\n\n<pre><code class=\"language-php\">public function testTheProjectNameShouldBeAString(): void\n{\n \/\/ ...\n}\n<\/code><\/pre>\n\n<p>Another popular way, particularly in some frameworks, is to use snake-case method names:<\/p>\n\n<pre><code class=\"language-php\">\/** @test *\/\npublic function the_project_name_should_be_a_string(): void\n{\n \/\/ ...\n}\n<\/code><\/pre>\n\n<p>This may be more readable but only works if the <code>@test<\/code> annotation is present.<\/p>\n\n<p>What if you need to add another annotation, such as <code>@dataProvider<\/code> to the test? Do you do multi-line docblocks everywhere, or mix and match single and multiple line docblocks depending on the test?<\/p>\n\n<h2 id=\"here%27s-the-thing\">Here's the thing<\/h2>\n\n<p>My preference switches between both ways of writing test methods.<\/p>\n\n<p>But, whichever way I write it, I write descriptive method names that explain what the test does - even if it means having a long method name.<\/p>\n\n<p>I avoid short and generic names like <code>testUpdate()<\/code>.<\/p>\n\n<p>People should be able to read the test name and understand what it does and what it's testing.<\/p>\n\n ",
"format":"full_html",
"processed":"\n <p>In PHPUnit, there are different ways to write test methods.<\/p>\n\n<p>The standard way is to use camel-case method names with a <code>test<\/code> prefix, for example:<\/p>\n\n<pre><code class=\"language-php\">public function testTheProjectNameShouldBeAString(): void\n{\n \/\/ ...\n}\n<\/code><\/pre>\n\n<p>Another popular way, particularly in some frameworks, is to use snake-case method names:<\/p>\n\n<pre><code class=\"language-php\">\/** @test *\/\npublic function the_project_name_should_be_a_string(): void\n{\n \/\/ ...\n}\n<\/code><\/pre>\n\n<p>This may be more readable but only works if the <code>@test<\/code> annotation is present.<\/p>\n\n<p>What if you need to add another annotation, such as <code>@dataProvider<\/code> to the test? Do you do multi-line docblocks everywhere, or mix and match single and multiple line docblocks depending on the test?<\/p>\n\n<h2 id=\"here%27s-the-thing\">Here's the thing<\/h2>\n\n<p>My preference switches between both ways of writing test methods.<\/p>\n\n<p>But, whichever way I write it, I write descriptive method names that explain what the test does - even if it means having a long method name.<\/p>\n\n<p>I avoid short and generic names like <code>testUpdate()<\/code>.<\/p>\n\n<p>People should be able to read the test name and understand what it does and what it's testing.<\/p>\n\n ",