Source of file PathfinderControllerExtensionTest.php
Size: 0,964 Bytes - Last Modified: 2021-12-24T06:40:50+00:00
/var/www/docs.ssmods.com/process/src/tests/units/PathfinderControllerExtensionTest.php
1234567891011121314151617181920212223242526272829303132333435363738 | <?php namespace CodeCraft\Pathfinder\Tests\Units; use CodeCraft\Pathfinder\Model\Pathfinder; use CodeCraft\Pathfinder\Model\PathfinderPage; use SilverStripe\CMS\Controllers\ModelAsController; use SilverStripe\Dev\FunctionalTest; /** * Testing the extension of controllers associated with models with a Pathfinder */ class PathfinderControllerExtensionTest extends FunctionalTest { /** * @var string */ protected static $fixture_file = '../fixtures/fixture-pathfinder.yml'; /** * @return void */ public function testPath() { /** @var PathfinderPage $page */ $page = $this->objFromFixture(PathfinderPage::class, 'page'); // Let's assume PathfinderPage has auto-created a Pathfinder $controller = ModelAsController::controller_for($page); $this->assertTrue( $controller->hasAction('pathfinder'), 'Should allow the "pathfinder" action' ); } } |