Phpunit tests gives warning no tests found in class
/** @test */public function it_tests_something(){ ...}
Adding that @test
tells phpunit to treat the function as a test, regardless of the name.
The only methods that PHPUnit will recognize as tests are those with names starting with test.
So you should rename the it_fetches_posts()
method to test_it_fetches_posts
or testItFetchesPosts
. The camel case naming is optional but useful if you use the --testdox option later.
Also, as stated in other answer you can also add the @test
annotation to any method and it will be considered a test by PHPUnit.