initial commit
This commit is contained in:
56
tests/unit/Laravel5/factories/ModelFactory.php
Normal file
56
tests/unit/Laravel5/factories/ModelFactory.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Model Factories
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may define all of your model factories. Model factories give
|
||||
| you a convenient way to create models for testing and seeding your
|
||||
| database. Just tell the factory how a default model should look.
|
||||
|
|
||||
*/
|
||||
|
||||
$factory->define(\XaiCorp\AbcParser\Models\Laravel5\Collection::class, function (Faker\Generator $faker) {
|
||||
return [
|
||||
'name' => $faker->name,
|
||||
];
|
||||
});
|
||||
|
||||
$factory->define(\XaiCorp\AbcParser\Models\Laravel5\Tune::class, function (Faker\Generator $faker) {
|
||||
return [
|
||||
'x_id' => $faker->numberBetween(1, 10),
|
||||
];
|
||||
});
|
||||
|
||||
$factory->define(\XaiCorp\AbcParser\Models\Laravel5\Person::class, function (Faker\Generator $faker) {
|
||||
return [
|
||||
'name' => $faker->name,
|
||||
'email'=> $faker->safeEmail,
|
||||
];
|
||||
});
|
||||
|
||||
$factory->define(\XaiCorp\AbcParser\Models\Laravel5\TuneAttribute::class, function (Faker\Generator $faker) {
|
||||
$types = \XaiCorp\AbcParser\Models\Laravel5\TuneAttribute::getTypes();
|
||||
return [
|
||||
'tune_id' => function () {
|
||||
return factory(\XaiCorp\AbcParser\Models\Laravel5\Tune::class)->create()->id;
|
||||
},
|
||||
'type' => $types[random_int(0, count($types)-1)],
|
||||
'string' => $faker->words(3, true),
|
||||
'ordering' => $faker->numberBetween(1, 5),
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
$factory->define(\XaiCorp\AbcParser\Models\Laravel5\CollectionAttribute::class, function (Faker\Generator $faker) {
|
||||
$types = \XaiCorp\AbcParser\Models\Laravel5\CollectionAttribute::getTypes();
|
||||
return [
|
||||
'collection_id' => function () {
|
||||
return factory(\XaiCorp\AbcParser\Models\Laravel5\Collection::class)->create()->id;
|
||||
},
|
||||
'type' => $types[random_int(0, count($types)-1)],
|
||||
'string' => $faker->words(3, true),
|
||||
'ordering' => $faker->numberBetween(1, 5),
|
||||
];
|
||||
});
|
||||
24
tests/unit/Laravel5/factories/TuneSettingFactory.php
Normal file
24
tests/unit/Laravel5/factories/TuneSettingFactory.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
|
||||
$factory->define(\XaiCorp\AbcParser\Models\Laravel5\TuneSetting::class, function (Faker\Generator $faker) {
|
||||
return [
|
||||
'tune_id' => function () {
|
||||
return factory(\XaiCorp\AbcParser\Models\Laravel5\Tune::class)->create()->id;
|
||||
},
|
||||
'meter' => 'C',
|
||||
'keysig' => '6/8',
|
||||
];
|
||||
});
|
||||
|
||||
$factory->define(\XaiCorp\AbcParser\Models\Laravel5\TuneSettingAttribute::class, function (Faker\Generator $faker) {
|
||||
$types = \XaiCorp\AbcParser\Models\Laravel5\TuneSettingAttribute::getTypes();
|
||||
return [
|
||||
'setting_id' => function () {
|
||||
return factory(\XaiCorp\AbcParser\Models\Laravel5\TuneSetting::class)->create()->id;
|
||||
},
|
||||
'type' => $types[random_int(0, count($types)-1)],
|
||||
'string' => $faker->words(3, true),
|
||||
'ordering' => $faker->numberBetween(1, 5),
|
||||
];
|
||||
});
|
||||
Reference in New Issue
Block a user