<div dir="ltr">Hi everyone, on my QA-related tasks I've found many of us use TestBuilder to generate random data for our tests (YAY!).<div>I just wanted to remind you that TestBuilder can now return Koha::Object-derived objects instead of just unblessed hashes now, through a new method:</div><div><br></div><div>my $builder = t::lib::TestBuilder->new();</div><div>my $patron = $builder->build_object({ class => 'Koha::Patrons' });</div><div><br></div><div>It was introduced to avoid this pattern we see very often on the tests:</div><div><br></div><div><div>my $builder = t::lib::TestBuilder->new();</div><div>my $patron_id = $builder->build({ source => 'Borrower' })->{'borrowernumber'};</div></div><div>my $patron = Koha::Patrons->find( $patron_id );</div><div><br></div><div>(or just to make use of object accessors without all the symbols handling hashrefs add, like in $patron->{'borrowernumber'}</div><div><br></div><div>At some point we could make ->build_object() replace ->build() for simplicity.</div><div><br></div><div>Regards</div><div><br></div></div><div dir="ltr">-- <br></div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div style="color:rgb(117,117,117);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:12.8px">Tomás Cohen Arazi</div><div style="color:rgb(117,117,117);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:12.8px">Theke Solutions (<a href="http://theke.io/">https://theke.io</a>)<br>✆ +54 9351 3513384<br>GPG: B2F3C15F</div></div></div>