Code Duplication    Length = 12-13 lines in 2 locations

tests/unit/Product/ProductDoctrineGatewayTest.php 1 location

@@ 39-50 (lines=12) @@
36
        return new Intraface_modules_product_ProductDoctrine;
37
    }
38
39
    function createProduct($name)
40
    {
41
        $product = $this->createProductObject();
42
        $product->getDetails()->Translation['da']->name = $name;
43
        $product->getDetails()->Translation['da']->description = '';
44
        $product->getDetails()->price = new Ilib_Variable_Float(20);
45
        $product->getDetails()->unit = 1;
46
        $product->has_variation = 1;
47
        $product->save();
48
        $product->refresh(true);
49
        return $product;
50
    }
51
52
    public function createAttribute($group_name, $attributes)
53
    {

tests/unit/Product/ProductDoctrineTest.php 1 location

@@ 35-47 (lines=13) @@
32
        return new Intraface_modules_product_ProductDoctrine;
33
    }
34
35
    function createNewProduct()
36
    {
37
        $product = $this->createProductObject();
38
        $product->getDetails()->Translation['da']->name = 'Test';
39
        $product->getDetails()->Translation['da']->description = '';
40
        $product->getDetails()->price = new Ilib_Variable_Float(20);
41
        $product->getDetails()->unit = 1;
42
        $product->save();
43
        $product->refresh(true);
44
        return $product;
45
        // $product->save(array('name' => 'Test', 'price' => 20, 'unit' => 1));
46
        // return $product;
47
    }
48
49
    function createNewProductWithVariations()
50
    {