YetiForceCompany/YetiForceCRM

View on GitHub
tests/Init/MailTest.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

Avoid using static access to class '\Settings_MailSmtp_Record_Model' in method 'testAddSmtp'.
Open

        $recordModel = \Settings_MailSmtp_Record_Model::getCleanInstance();
Severity: Minor
Found in tests/Init/MailTest.php by phpmd

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', '');
Severity: Minor
Found in tests/Init/MailTest.php by phpmd

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();
Severity: Minor
Found in tests/Init/MailTest.php by phpmd

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);
Severity: Critical
Found in tests/Init/MailTest.php by phan

Spaces must be used to indent lines; tabs are not allowed
Open

        $recordModel->set('reply_to', '');
Severity: Minor
Found in tests/Init/MailTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $recordModel->set('default', 1);
Severity: Minor
Found in tests/Init/MailTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $recordModel->set('authentication', 1);
Severity: Minor
Found in tests/Init/MailTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $recordModel->set('from_email', 'YetiForce@fake.smtp');
Severity: Minor
Found in tests/Init/MailTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $recordModel->set('from_name', 'YetiForce fake smtp');
Severity: Minor
Found in tests/Init/MailTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $defaultSmtp = \App\Mail::getDefaultSmtp();
Severity: Minor
Found in tests/Init/MailTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $recordModel = \Settings_MailSmtp_Record_Model::getCleanInstance();
Severity: Minor
Found in tests/Init/MailTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $recordModel->set('secure', 'tls');
Severity: Minor
Found in tests/Init/MailTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $recordModel->set('mailer_type', 'smtp');
Severity: Minor
Found in tests/Init/MailTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Testing getAll function.
Severity: Minor
Found in tests/Init/MailTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $recordModel->set('options', '');
Severity: Minor
Found in tests/Init/MailTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in tests/Init/MailTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $recordModel->set('individual_delivery', 0);
Severity: Minor
Found in tests/Init/MailTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $recordModel->set('port', 587);
Severity: Minor
Found in tests/Init/MailTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $recordModel->set('password', 'YetiForce fake pass');
Severity: Minor
Found in tests/Init/MailTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $recordModel->save();
Severity: Minor
Found in tests/Init/MailTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        static::assertNotEmpty($defaultSmtp);
Severity: Minor
Found in tests/Init/MailTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $recordModel->set('host', 'Fake SMTP');
Severity: Minor
Found in tests/Init/MailTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $recordModel->set('username', 'YetiForce@fake.smtp');
Severity: Minor
Found in tests/Init/MailTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in tests/Init/MailTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        \App\Cache::delete('DefaultSmtp', '');
Severity: Minor
Found in tests/Init/MailTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function testAddSmtp()
Severity: Minor
Found in tests/Init/MailTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $recordModel->set('name', 'Fake SMTP');
Severity: Minor
Found in tests/Init/MailTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in tests/Init/MailTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in tests/Init/MailTest.php by phpcodesniffer

There are no issues that match your filters.

Category
Status