This module automatically creates database records for you. If needed, records for foreign keys are created too. Values will be randomly generated if not passed to TestBuilder. Note that you should wrap these actions in a transaction yourself.

$builder->build({ source => $source_name, value => $value });
Create a test record in the table, represented by $source_name.
The name is required and must conform to the DBIx::Class schema.
Values may be specified by the optional $value hashref. Will be
randomized otherwise.
If needed, TestBuilder creates linked records for foreign keys.
Returns the values of the new record as a hashref, or undef if
the record could not be created.
Note that build also supports recursive hash references inside the
value hash for foreign key columns, like:
value => {
column1 => 'some_value',
fk_col2 => {
columnA => 'another_value',
}
}
The hash for fk_col2 here means: create a linked record with build
where columnA has this value. In case of a composite FK the hashes
are merged.
Realize that passing primary key values to build may result in undef
if a record with that primary key already exists.

Koha is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

Koha is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Koha; if not, see <http://www.gnu.org/licenses>.