| Total Complexity | 4 |
| Total Lines | 59 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class GetEnvVariableTest extends EnvHandlerTestCase |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * Instancia a classe de validação para ser testada |
||
| 15 | * |
||
| 16 | * @return void |
||
| 17 | */ |
||
| 18 | public function setUp() : void |
||
| 19 | { |
||
| 20 | parent::setUp(); |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Verifica se é possível recuperar um valor de uma variavel de ambiente inexistente |
||
| 25 | * no arquivo |
||
| 26 | * |
||
| 27 | * @return void |
||
| 28 | */ |
||
| 29 | public function testGetEnvVariableInvalid() |
||
| 30 | { |
||
| 31 | $key = 'THEME_CURRENT_' . time(); |
||
| 32 | |||
| 33 | $handler = new EnvHandler(); |
||
| 34 | |||
| 35 | $this->assertNull($handler->get($key)); |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Verifica se é possível tentar recuperar uma chave, sem passar o nome |
||
| 40 | * dela na função get. |
||
| 41 | * Por padrão, deve emitir um erro de argumento |
||
| 42 | * |
||
| 43 | * @return void |
||
| 44 | */ |
||
| 45 | public function testGeWithtNullableKey() |
||
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * Verifica se é possível tentar recuperar uma chave, passando |
||
| 58 | * tipos diferentes de string |
||
| 59 | * Por padrão, deve emitir um ErrorException |
||
| 60 | * |
||
| 61 | * @return void |
||
| 62 | */ |
||
| 63 | public function testGetWithInvalidTypeKey() |
||
| 70 | } |
||
| 71 | } |
This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.