TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Testing: How to actually write tests?

1 pointsby jeykeuover 2 years ago

2 comments

zach_garwoodover 2 years ago
You could streamline the test a bit by using `assertSeeInOrder()`:<p><pre><code> $posts = ... $titles = $posts-&gt;pluck(&#x27;title&#x27;); $this-&gt;get(&#x27;&#x2F;posts&#x27;) ... -&gt;assertSeeInOrder($titles);</code></pre>
jeykeuover 2 years ago
Write tests in Laravel using PHPUnit and the Given-When-Then pattern. I also explain how to use the “Red-Green-Refactor” approach with TDD.