tests/App/Config.php
Avoid using static access to class '\App\Config' in method 'testSetJsEnv'. Open
Open
$this->assertNull(\App\Config::setJsEnv('UnitTestsTestVar', 'Test'));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Config' in method 'testGetJsEnv'. Open
Open
$this->assertNotEmpty(\App\Config::getJsEnv(), 'Json string expected');
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Call to undeclared method \Tests\App\Config::assertNotEmpty
Open
Open
$this->assertNotEmpty(\App\Config::getJsEnv(), 'Json string expected');
- Exclude checks
Call to undeclared method \Tests\App\Config::assertNull
Open
Open
$this->assertNull(\App\Config::setJsEnv('UnitTestsTestVar', 'Test'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$this->assertNotEmpty(\App\Config::getJsEnv(), 'Json string expected');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Testing JS env vars getter.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Testing JS env var setter.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$this->assertNull(\App\Config::setJsEnv('UnitTestsTestVar', 'Test'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function testGetJsEnv()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function testSetJsEnv()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks