Jump to:

23460 Posts in 18907 Topics by 2877 members

General Questions

SilverStripe Forums » General Questions » Functional Test Director::test always returns 404

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 152 Views
  • vtsr60
    Community Member
    1 Post

    Functional Test Director::test always returns 404 Link to this post

    Hi I am trying out the Unit testing in SilverStripe, I got stuck, I am pretty new to SilverStripe.

    My Unit test files looks like this

    class FrontBasicTest extends FunctionalTest {
        protected static $fixture_file = 'mysite/tests/FrontBasicTest.yml';
       * Test generation of the view
       public function testBasicView() {
          $response1 = Director::test('about/');

    YML File I have put this

    Title: Home
    Title: About Us
    Title: Staff
    URLSegment: my-staff
    Parent: =>Page.about

    RedirectionType: Internal
    LinkTo: =>Page.home

    I tried different things, but I always get 404 error page as the Print output.

    But If I access the admin page it working as expected, for example 'admin/pages' is returning login page.

    My main aim to to grab HTML of the front site page and check for particular div present, So Please let me know what I am doing worng, How can I grab the HTML of the front site page in unit test.

    Thank you

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.