seregazhuk/php-headhunter-api

View on GitHub
tests/EndpointContainerTest.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using static access to class '\Mockery' in method 'setUp'.
Open

        $this->request = Mockery::mock(Request::class);
Severity: Minor
Found in tests/EndpointContainerTest.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 '\Mockery' in method 'tearDown'.
Open

        Mockery::close();
Severity: Minor
Found in tests/EndpointContainerTest.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

Method name "EndpointsContainerTest::it_returns_a_provider_instance" is not in camel caps format
Open

    public function it_returns_a_provider_instance()

Expected 1 blank line at end of file; 2 found
Open

}

Method name "EndpointsContainerTest::it_delegates_setters_to_request_object" is not in camel caps format
Open

    public function it_delegates_setters_to_request_object()

Method name "EndpointsContainerTest::it_throws_exception_when_accessing_request_setter_that_doesnt_exist" is not in camel caps format
Open

    public function it_throws_exception_when_accessing_request_setter_that_doesnt_exist()

Method name "EndpointsContainerTest::it_throws_exception_when_trying_to_access_wrong_provider" is not in camel caps format
Open

    public function it_throws_exception_when_trying_to_access_wrong_provider()

Opening brace should be on a new line
Open

    public function tearDown() {

The method it_throws_exception_when_trying_to_access_wrong_provider is not named in camelCase.
Open

    public function it_throws_exception_when_trying_to_access_wrong_provider()
    {
        $this->expectException(WrongEndPointException::class);
        $this->container->getEndpoint('unknown');
    }
Severity: Minor
Found in tests/EndpointContainerTest.php by phpmd

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method it_throws_exception_when_accessing_request_setter_that_doesnt_exist is not named in camelCase.
Open

    public function it_throws_exception_when_accessing_request_setter_that_doesnt_exist()
    {
        $this->expectException(HeadHunterApiException::class);
        $this->container->setProperty('value');
    }
Severity: Minor
Found in tests/EndpointContainerTest.php by phpmd

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method it_delegates_setters_to_request_object is not named in camelCase.
Open

    public function it_delegates_setters_to_request_object()
    {
        $host = 'value';
        $this->request->shouldReceive('setHost')
            ->once()
Severity: Minor
Found in tests/EndpointContainerTest.php by phpmd

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method it_returns_a_provider_instance is not named in camelCase.
Open

    public function it_returns_a_provider_instance()
    {
        $provider = $this->container->vacancies;
        $this->assertInstanceOf(Vacancies::class, $provider);
    }
Severity: Minor
Found in tests/EndpointContainerTest.php by phpmd

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

There are no issues that match your filters.

Category
Status