Jump to:

22977 Posts in 11806 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » Silverstripe 3.1 bug/error PHP Unit tests.

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: 240 Views
  • Schippie
    Avatar
    Community Member
    23 Posts

    Silverstripe 3.1 bug/error PHP Unit tests. Link to this post

    I am having an issue and i cannot seem to find the cause immediately. I am trying to push data into the member class. Through a YML file in a test case. The result is an error saying that it was expecting a string but received an array.

    The error occurs at: framework/dev/fixtureblueprint line 248

    protected function parseValue($value, $fixtures = null) {
          if(substr($value,0,2) == '=>') {

    Where obvious array is not a string.

    YML file looks something like:

    Member:
    member1:
    FirstName: Foo
    Surname: Foo2
    member2:
    FirstName: Test
    Surname: Test2

    Now when going through the code i find that it grabs member2 and treats it as if it is a row below member1 aka it sees the yml as:

    Member:
    member1:
    FirstName: Foo
    Surname: Foo2
    member2: array()

    My question now being what would cause this or is it simply an fairly unclear indicator that data is missing/incorrect/does not match a database column

  • simon_w
    Avatar
    Forum Moderator
    467 Posts

    Re: Silverstripe 3.1 bug/error PHP Unit tests. Link to this post

    member2 is indented more than member1, thus is treated as a property of it.

  • Schippie
    Avatar
    Community Member
    23 Posts

    Re: Silverstripe 3.1 bug/error PHP Unit tests. Link to this post

    Jup tried it, so stupid should have done what the configuration apparently said use 2 spaces not tabs like i am used to.
    Though that seriously needs a better error

    240 Views
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.