Completed
Push — master ( e4ab2b...e8d46a )
by Franco
24s queued 18s
created

testDefaultRecordsAreCreated()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 9
nc 1
nop 0
1
<?php
2
3
class DMSTaxonomyTypeExtensionTest 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...
4
{
5
    protected $usesDatabase = true;
6
7
    protected $requiredExtensions = array(
8
        'TaxonomyType' => array('DMSTaxonomyTypeExtension')
9
    );
10
11
    /**
12
     * Ensure that the configurable list of default records are created
13
     */
14
    public function testDefaultRecordsAreCreated()
15
    {
16
        Config::inst()->update('DMSTaxonomyTypeExtension', 'default_records', array('Food', 'Beverage', 'Books'));
17
18
        TaxonomyType::create()->requireDefaultRecords();
19
20
        $this->assertDOSContains(
21
            array(
22
                array('Name' => 'Food'),
23
                array('Name' => 'Beverage'),
24
                array('Name' => 'Books'),
25
            ),
26
            TaxonomyType::get()
27
        );
28
    }
29
}
30