AccordionTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 28
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testAccordionConnected() 0 8 1
A testAccordionOutput() 0 13 1
1
<?php
2
3
4
class AccordionTest extends SapphireTest
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
5
{
6
7
    protected static $fixture_file = '../fixtures/accordion.yml';
8
9
    public function testAccordionConnected()
10
    {
11
        $page = $this->objFromFixture('Page', 'page1');
12
        $this->objFromFixture('AccordionItem', 'item1');
13
        $this->objFromFixture('AccordionItem', 'item2');
14
15
        $this->assertEquals(2, (int)$page->AccordionItems()->count());
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<AccordionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
16
    }
17
18
    public function testAccordionOutput()
19
    {
20
        $page = $this->objFromFixture('Page', 'page1');
21
        $page->Content = '[accordion]';
22
        $this->objFromFixture('AccordionItem', 'item1');
23
        $this->objFromFixture('AccordionItem', 'item2');
24
25
        $backend = new SSViewer('AccordionItems');
26
        $html = $backend->process($page);
27
        $this->assertContains('AccordionItem1', $html);
28
        $this->assertContains('AccordionItem2', $html);
29
30
    }
31
}