Code Duplication    Length = 38-38 lines in 2 locations

src/Tests/Behat/Page/Admin/CustomBlock/CreatePage.php 1 location

@@ 7-44 (lines=38) @@
4
5
use Sylius\Behat\Page\Admin\Crud\CreatePage as BaseCreatePage;
6
7
class CreatePage extends BaseCreatePage implements CreatePageInterface
8
{
9
    /**
10
     * {@inheritdoc}
11
     */
12
    public function setName($name)
13
    {
14
        $this->getSession()->getPage()->fillField('Name', $name);
15
    }
16
17
    /**
18
     * {@inheritdoc}
19
     */
20
    public function setBody($body)
21
    {
22
        $this->getSession()->getPage()->fillField('Body', $body);
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function setTitle($title)
29
    {
30
        $this->getSession()->getPage()->fillField('Title', $title);
31
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36
    protected function getDefinedElements()
37
    {
38
        return array_merge(parent::getDefinedElements(), [
39
            'body' => '#lakion_sylius_cms_custom_block_body',
40
            'name' => '#lakion_sylius_cms_custom_block_name',
41
            'title' => '#lakion_sylius_cms_custom_block_title',
42
        ]);
43
    }
44
}
45

src/Tests/Behat/Page/Admin/StaticContent/CreatePage.php 1 location

@@ 7-44 (lines=38) @@
4
5
use Sylius\Behat\Page\Admin\Crud\CreatePage as BaseCreatePage;
6
7
final class CreatePage extends BaseCreatePage implements CreatePageInterface
8
{
9
    /**
10
     * {@inheritdoc}
11
     */
12
    public function setTitle($title)
13
    {
14
        $this->getSession()->getPage()->fillField('Title', $title);
15
    }
16
17
    /**
18
     * {@inheritdoc}
19
     */
20
    public function setName($name)
21
    {
22
        $this->getSession()->getPage()->fillField('Internal name', $name);
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function setBody($body)
29
    {
30
        $this->getSession()->getPage()->fillField('Body', $body);
31
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36
    protected function getDefinedElements()
37
    {
38
        return array_merge(parent::getDefinedElements(), [
39
            'body' => '#lakion_sylius_cms_static_content_body',
40
            'name' => '#lakion_sylius_cms_static_content_name',
41
            'title' => '#lakion_sylius_cms_static_content_title',
42
        ]);
43
    }
44
}
45