Source of file AdvertSiteTreeExtensionTest.php
Size: 0,945 Bytes - Last Modified: 2021-12-23T10:58:29+00:00
/var/www/docs.ssmods.com/process/src/tests/AdvertSiteTreeExtensionTest.php
123456789101112131415161718192021222324252627 | <?php class AdvertSiteTreeExtensionTest extends SapphireTest { public static $fixture_file = 'adverts/tests/adverts.yml'; /* Test child of a parent with a set advert category ID */ public function testCalculateAdvertCategoryIDChild() { $sectionPage = $this->objFromFixture('Page', 'Section'); $page = $this->objFromFixture('Page', 'SectionChild'); $categoryID = $page->CalculateAdvertCategoryID(); $this->assertEquals($sectionPage->AdvertCategoryID, $categoryID); } /* Test grandchild of a grandparent with a set advert category ID */ public function testCalculateAdvertCategoryIDGrandChild() { $sectionPage = $this->objFromFixture('Page', 'Section'); $page = $this->objFromFixture('Page', 'SectionGrandChild'); $categoryID = $page->CalculateAdvertCategoryID(); $this->assertEquals($sectionPage->AdvertCategoryID, $categoryID); } } |