Source of file InlineHelpTest.php
Size: 1,351 Bytes - Last Modified: 2021-12-23T10:48:18+00:00
/var/www/docs.ssmods.com/process/src/tests/InlineHelpTest.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344 | <?php /** * @package silverstripe-inlinehelp * @subpackage tests */ class InlineHelpTest extends SapphireTest { public static $fixture_file = 'inlinehelp/tests/InlineHelpTest.yml'; public function testAttachAllPages() { $home = $this->objFromFixture('SiteTree', 'home')->getHelpItems(); $this->assertEquals(1, count($home)); $this->assertEquals('All Pages Help', $home->First()->Title); } public function testAttachSpecificPages() { $about = $this->objFromFixture('SiteTree', 'about')->getHelpItems(); $contact = $this->objFromFixture('SiteTree', 'contact')->getHelpItems(); foreach (array($about, $contact) as $fixture) { $this->assertEquals(2, count($fixture)); $this->assertEquals(array('All Pages Help', 'Specific Pages Help'), array_values($fixture->map())); } } public function testAttachChildPages() { $location = $this->objFromFixture('SiteTree', 'location')->getHelpItems(); $this->assertEquals(2, count($location)); $this->assertEquals(array('All Pages Help', 'Child Pages Help'), array_values($location->map())); } public function testAttachPageType() { $location = $this->objFromFixture('ErrorPage', '404')->getHelpItems(); $this->assertEquals(2, count($location)); $this->assertEquals(array('All Pages Help', 'Error Page Help'), array_values($location->map())); } } |