GalleryElementTest::tearDown()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
require_once 'CMSStubs.php';
3
require_once 'Intraface/modules/cms/Element.php';
4
require_once 'Intraface/modules/cms/element/Gallery.php';
5
6
class GalleryElementTest extends PHPUnit_Framework_TestCase
7
{
8
    private $gallery;
9
10 View Code Duplication
    function setUp()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
11
    {
12
        $kernel = new Stub_Kernel();
13
        $site = new FakeCMSSite($kernel);
14
        $page = new FakeCMSPage($site);
15
        $section = new FakeCMSSection($page);
16
        $this->gallery = new Intraface_modules_cms_element_Gallery($section);
17
    }
18
19
    function tearDown()
20
    {
21
        unset($this->gallery);
22
    }
23
24
    function testConstruction()
25
    {
26
        $this->assertTrue(is_object($this->gallery));
27
    }
28
29
    function testSave()
30
    {
31
        $data = array(
32
            'elm_properties' => 'none',
33
            'elm_adjust' => 'left',
34
            'elm_width' => '100px',
35
            'gallery_select_method' => 'single_image',
36
            'thumbnail_size' => 'small',
37
            'popup_size' => 'medium',
38
            'show_description' => true
39
        );
40
41
        $this->assertTrue($this->gallery->save($data) > 0);
42
    }
43
}
44