Issues (80)

tests/AdvertSiteTreeExtensionTest.php (1 issue)

1
<?php
2
3
class AdvertSiteTreeExtensionTest 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
    public static $fixture_file = 'adverts/tests/adverts.yml';
6
7
    /*
8
    Test child of a parent with a set advert category ID
9
     */
10
    public function testCalculateAdvertCategoryIDChild() {
11
        $sectionPage = $this->objFromFixture('Page', 'Section');
12
        $page = $this->objFromFixture('Page', 'SectionChild');
13
        $categoryID = $page->CalculateAdvertCategoryID();
14
        $this->assertEquals($sectionPage->AdvertCategoryID, $categoryID);
15
    }
16
17
    /*
18
    Test grandchild of a grandparent with a set advert category ID
19
     */
20
    public function testCalculateAdvertCategoryIDGrandChild() {
21
        $sectionPage = $this->objFromFixture('Page', 'Section');
22
        $page = $this->objFromFixture('Page', 'SectionGrandChild');
23
        $categoryID = $page->CalculateAdvertCategoryID();
24
        $this->assertEquals($sectionPage->AdvertCategoryID, $categoryID);
25
    }
26
}
27