Usualy when I figure out the answer for my question, I delete that question if the answer was so obvious or it was just a typo, but I do not do it now. The reason for this that the solution is not so obvious, and it could be handy for others.
I am using Netbeans 8.2
When you use netbeans, and want to set PHPUnit, you can set the:
Options -> PHP -> Framework & Tools -> PHPUnit
One of the input field called: Skeleton Generator script.
This script helps you create a sekeleton when you create a new test from netbeans.
The only one you need to add to the Include Path is the path to your PHPUnit directory, for me it's: D:\phpunit
The test file start like this:
<?php
/**
* Generated by PHPUnit_SkeletonGenerator on 2017-03-06 at 15:56:58.
*/
class AbcTest extends PHPUnit_Framework_TestCase {
Sadly, you can not change it, because it is in the phpunit-skelgen-2.0.1.phar, what won't work if you made some changes in it. There is an integrity check what prevents you to change the contents of the file.
So, the problem is that there is no class like this:
PHPUnit_Framework_TestCase
I think there is an autoloader method what turns it to \PHPUnit\Framework\TestCase.
The solution is to change the word after extends to this:
class AbcTest extends PHPUnit\Framework\TestCase
or
use PHPUnit\Framework\TestCase;
class AbcTest extends TestCase {
After this, when you start to type $this-> you will get the autocomplete list.