Skip to content

setUp method not created #51

@Prometee

Description

@Prometee

Here is the case:

final class CheckboxAttributeTypeSpec extends ObjectBehavior
{
    function it_is_initializable(): void
    {
        $this->shouldHaveType(CheckboxAttributeType::class);
    }

    function it_implements_attribute_type_interface(): void
    {
        $this->shouldImplement(AttributeTypeInterface::class);
    }
}

?>

Current result

final class CheckboxAttributeTypeTest extends \PHPUnit\Framework\TestCase
{
    public function testImplementsAttributeTypeInterface(): void
    {
        $this->assertInstanceOf(AttributeTypeInterface::class, $this->checkboxAttributeType);
    }
}

Expected result

final class CheckboxAttributeTypeTest extends \PHPUnit\Framework\TestCase
{
    private CheckboxAttributeType $checkboxAttributeType;
    protected function setUp(): void
    {
        $this->checkboxAttributeType = new CheckboxAttributeType();
    }
    function testImplementsAttributeTypeInterface(): void
    {
        $this->assertInstanceOf(AttributeTypeInterface::class, $this->checkboxAttributeType);
    }
}

Can you help me figuring why the setUp method is not created and also why the it_is_initializable is skipped?

Then I can provide a PR ;)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions