Alice Random Element fixture throwing errors on loading

I have created a test fixture using the documentation available here. The fixture contains the following entries

        fstype_ShortCode: <randomElement($shortsode = array ('BS','IS','DR','MR','CS','AR','FP','PL','ME','CF','NO'))>
        fstype_Name: <sentence(3)>
        fstype_CreatedBy: <randomNumber($nbDigits = 9, $strict = false)>
        fstype_CreatedOn: <date($format = 'Y-m-d', $max = 'now')>

When I load the fixture I get the following error

In SimpleObjectGenerator.php line 112:
  An error occurred while generating the fixture "financial_statement_type_1" (AppEntityfinancial_statement_type): Could not resolve value during the generation process.  

In UnresolvableValueDuringGenerationExceptionFactory.php line 25:
  Could not resolve value during the generation process.  

In UnresolvableValueExceptionFactory.php line 77:
  Could not find a variable "$shortcode". 

I am unable to figure out where exactly its looking for the variable $shortcode when its alrady available in the fixture. Or the method in whcih I have written the fixture is incorrect? In which case what would be the correct way to rewrite this.

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *