Code Duplication    Length = 12-12 lines in 2 locations

src/system/BlocksModule/Tests/Api/BlockFactoryApiTest.php 2 locations

@@ 87-98 (lines=12) @@
84
    /**
85
     * @covers BlockFactoryApiInterface::getInstance()
86
     */
87
    public function testGetInstanceOfAbstractExtensionBlock()
88
    {
89
        $blockInstance = $this->api->getInstance(BarBlock::class, new AcmeFooModule());
90
        $this->assertNotEmpty($blockInstance);
91
        $this->assertInstanceOf(AbstractBlockHandler::class, $blockInstance);
92
        $this->assertEquals('Bar', $blockInstance->getType());
93
        $serviceNameHelper = new ServiceNameHelper();
94
        $blockServiceName = $serviceNameHelper->generateServiceNameFromClassName(BarBlock::class);
95
        $this->assertTrue($this->container->has($blockServiceName));
96
        $retrievedBlockService = $this->container->get($blockServiceName);
97
        $this->assertInstanceOf(BlockHandlerInterface::class, $retrievedBlockService);
98
    }
99
100
    /**
101
     * @covers BlockFactoryApiInterface::getInstance()
@@ 103-114 (lines=12) @@
100
    /**
101
     * @covers BlockFactoryApiInterface::getInstance()
102
     */
103
    public function testGetInstanceOfInterfaceExtensionBlock()
104
    {
105
        $blockInstance = $this->api->getInstance(FooBlock::class);
106
        $this->assertNotEmpty($blockInstance);
107
        $this->assertInstanceOf(BlockHandlerInterface::class, $blockInstance);
108
        $this->assertEquals('FooType', $blockInstance->getType());
109
        $serviceNameHelper = new ServiceNameHelper();
110
        $blockServiceName = $serviceNameHelper->generateServiceNameFromClassName(FooBlock::class);
111
        $this->assertTrue($this->container->has($blockServiceName));
112
        $retrievedBlockService = $this->container->get($blockServiceName);
113
        $this->assertInstanceOf(BlockHandlerInterface::class, $retrievedBlockService);
114
    }
115
}
116