Skip to content

Instantly share code, notes, and snippets.

View BentBr's full-sized avatar

Bent Brüggemann BentBr

  • Blackbit
  • Hamburg
View GitHub Profile
@BentBr
BentBr / test_assignment.md
Created April 22, 2020 12:54 — forked from ignar/test_assignment.md
Brandslisten GmbH Test Assignment

Brandslisten GmbH Test Assignment

Let's assume, that got back into dark ages when developers haven't FactoryGirl gem and had to use fixtures instead.

You are first one, who understood that fixtures are not so handy as other think they are. You decide to write you own library and open source it for the world. FactoryBoy is looking like a good name.

You started from the simple class that you want to test and looks as simple as it is:

class User

attr_accessor :name, :email

@BentBr
BentBr / Member.php
Last active May 12, 2018 11:57
Eloquent Model for a family tree.One can find parents, children and partner through relations.
<?php
namespace SaveMyData\Models;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent;
use Illuminate\Support\Carbon;
use Illuminate\Support\Collection;