Completed
Pull Request — master (#168)
by Franco
02:41
created

tests/extensions/DMSTaxonomyTypeExtensionTest.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

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