jaroslavtyc/drd-plus-equipment

View on GitHub
tests/Equipment/ItemTest.php

Summary

Maintainability
A
0 mins
Test Coverage

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

            ->with(\Mockery::type(Item::class));
Severity: Minor
Found in tests/Equipment/ItemTest.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

The method I_can_not_create_it_with_empty_name is not named in camelCase.
Open

    public function I_can_not_create_it_with_empty_name()
    {
        $this->expectException(\DrdPlus\Equipment\Exceptions\ItemNameCanNotBeEmpty::class);
        new Item('', $this->createWeight());
    }
Severity: Minor
Found in tests/Equipment/ItemTest.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 I_can_create_it_without_any_container is not named in camelCase.
Open

    public function I_can_create_it_without_any_container()
    {
        $item = new Item('foo', $weight = $this->createWeight());
        self::assertSame('foo', $item->getName());
        self::assertSame('foo', (string)$item);
Severity: Minor
Found in tests/Equipment/ItemTest.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 I_can_create_it_with_container is not named in camelCase.
Open

    public function I_can_create_it_with_container()
    {
        $item = new Item(
            'foo',
            $weight = $this->createWeight(),
Severity: Minor
Found in tests/Equipment/ItemTest.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 I_can_set_and_change_container is not named in camelCase.
Open

    public function I_can_set_and_change_container()
    {
        $item = new Item('foo', $this->createWeight());
        self::assertNull($item->getBelongings());
        $item->setBelongings($belongings = $this->createBelongings());
Severity: Minor
Found in tests/Equipment/ItemTest.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