Avoid using static access to class '\Settings_MailSmtp_Record_Model' in method 'testAddSmtp'. Open
$recordModel = \Settings_MailSmtp_Record_Model::getCleanInstance();
- 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\Cache' in method 'testAddSmtp'. Open
\App\Cache::delete('DefaultSmtp', '');
- 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\Mail' in method 'testAddSmtp'. Open
$defaultSmtp = \App\Mail::getDefaultSmtp();
- 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
Static call to undeclared method \Tests\Init\MailTest::assertNotEmpty
Open
static::assertNotEmpty($defaultSmtp);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('reply_to', '');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('default', 1);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('authentication', 1);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('from_email', 'YetiForce@fake.smtp');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('from_name', 'YetiForce fake smtp');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$defaultSmtp = \App\Mail::getDefaultSmtp();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel = \Settings_MailSmtp_Record_Model::getCleanInstance();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('secure', 'tls');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('mailer_type', 'smtp');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Testing getAll function.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('options', '');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('individual_delivery', 0);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('port', 587);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('password', 'YetiForce fake pass');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->save();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
static::assertNotEmpty($defaultSmtp);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('host', 'Fake SMTP');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('username', 'YetiForce@fake.smtp');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Cache::delete('DefaultSmtp', '');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testAddSmtp()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('name', 'Fake SMTP');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks