Code Duplication    Length = 32-32 lines in 2 locations

tests/CareCleaningDocTest.php 1 location

@@ 3-34 (lines=32) @@
1
<?php
2
3
class CareCleaningDocTest extends SapphireTest
4
{
5
    /**
6
     * @var string
7
     */
8
    protected static $fixture_file = 'product-catalog/tests/fixtures.yml';
9
10
    /**
11
     *
12
     */
13
    public function testGetCMSFields()
14
    {
15
        $object = new CareCleaningDoc();
16
        $fields = $object->getCMSFields();
17
        $this->assertInstanceOf('FieldList', $fields);
18
        $this->assertNull($fields->dataFieldByName('Products'));
19
20
        $object = $this->objFromFixture('CareCleaningDoc', 'one');
21
        $fields = $object->getCMSFields();
22
        $this->assertInstanceOf('FieldList', $fields);
23
        $this->assertNotNull($fields->dataFieldByName('Products'));
24
    }
25
26
    /**
27
     *
28
     */
29
    public function testGetProductsCt()
30
    {
31
        $object = $this->objFromFixture('CareCleaningDoc', 'one');
32
        $this->assertEquals($object->getProductsCt(), 1);
33
    }
34
}
35

tests/WarrantyTest.php 1 location

@@ 3-34 (lines=32) @@
1
<?php
2
3
class WarrantyTest extends SapphireTest
4
{
5
    /**
6
     * @var string
7
     */
8
    protected static $fixture_file = 'product-catalog/tests/fixtures.yml';
9
10
    /**
11
     *
12
     */
13
    public function testGetCMSFields()
14
    {
15
        $object = new Warranty();
16
        $fields = $object->getCMSFields();
17
        $this->assertInstanceOf('FieldList', $fields);
18
        $this->assertNull($fields->dataFieldByName('Products'));
19
20
        $object = $this->objFromFixture('Warranty', 'one');
21
        $fields = $object->getCMSFields();
22
        $this->assertInstanceOf('FieldList', $fields);
23
        $this->assertNotNull($fields->dataFieldByName('Products'));
24
    }
25
26
    /**
27
     *
28
     */
29
    public function testGetProductsCt()
30
    {
31
        $object = $this->objFromFixture('Warranty', 'one');
32
        $this->assertEquals($object->getProductsCt(), 1);
33
    }
34
}
35